[Cialug] Learning the 'C' language

Chris Hilton chris129 at cs.iastate.edu
Thu Oct 13 13:56:01 CDT 2005


C is essential to Python.  If you want fast code in Python, the last thing you 
want to write it in is Python.  I've tested this before, and on iterative 
processes doing math calculations Python is dramatically slower (for example, 
I calculated the prime numbers between 1 and 1 million, took Python 30 times 
longer than c, c++, and Java).  But Python is supposed to allow easy c 
calls...  So, when you want to render image a on top of image b in way q, you 
do it in c, not Python!

I've found Python wonderful for checking my combinitorics homework though :).  
Mostly because of the programming on stdin functionality!

On Thursday 13 October 2005 12:58 pm, Brendon J. Colby wrote:
> > Tad Anhalt wrote:
> >
> > Good stuff - I just can't resist the temptation to amplify one some of
> > Tad's suggestions.
>
> Wow what a great thread. I'm definitely going to save this info. I've
> always wanted to learn C, but I've never found any projects in my
> professional or personal life where C made sense. I learn best when I have
> a project to work on, rather than doing "hello world" examples ad nauseum
> (i.e. the worthless college class I took). I just haven't found anything
> that Python, Perl, or PHP couldn't handle.
>
> I didn't see the O'Reilly book "Practical C Programming" mentioned. I
> think this is an amazing beginner to intermediate C book. I have the "old
> testament" and its very expensive answer book as well. :) Most other books
> seem to be too advanced or too beginner.
>
> One thing I saw mentioned was "unit testing." As a (relatively new) python
> programmer, I've begun writing my code with unit testing in mind i.e.
> writing the unit tests before I write the function, testing returns for
> every possible input and output scenario I can think of. I think this is a
> very wise thing to do (testing input output scenarios at least, whether
> before or after writing functions). This way any time I change something
> my unit test will (hopefully) tell me if I messed something up.
>
> Also I'd like emphasize 'Learn how the obfuscated and/or "efficient"
> and/or "mind blowing" code works, don't be tempted to use it in production
> code.' I really despise "cute" code and/or comments. I think straight
> forward, easily readable and self-documenting approaches are far more
> beneficial in the long run. I tend to be quite methodical and machine like
> when I code, even in the  comments, and stay away from the "mind blowing"
> and the "cute." Although I do like making perl do as much as possible in
> one line...
>
> Thanks for all the links and pointers everyone. This is really great info.
>
> Brendon
>
> _______________________________________________
> Cialug mailing list
> Cialug at cialug.org
> http://cialug.org/mailman/listinfo/cialug

-- 
"The only winning move is not to play."


More information about the Cialug mailing list