Efficient python programming...

holger krekel pyth at devel.trillke.net
Fri Jun 7 08:17:49 EDT 2002


Peter Hansen wrote:
> Eddie Corns wrote:
> > 
> > A friend is fond of quoting this to me:
> > 
> >   Rules of Optimization:
> >     Rule 1: Don't do it.
> >     Rule 2 (for experts only): Don't do it yet.
> >   -- M.A. Jackson
> > 
> > I wasn't going to bother contributing since others have said the same thing
> > but the more people say the more you'll believe it :)
> > 
> > Especially for a beginner the important thing is to get clear and obvious
> > code.  Later, IF IT ISN'T FAST ENOUGH, then you think about ways to speed it
> > up.
> 
> You forgot the even more important first thing for a beginner: 
> get it correct!  The only good way to do this is to write unit
> tests that prove it.  If you don't have tests, you don't have 
> working code (or how can you prove it?).

yeah. writing tests is *the way* to go if you want other people use 
your code. Although successfull unittests theoretically don't prove 
anything<wink> they tend to do in reality<doublewink>. 

if-it's-not-proven-then-test-it-ly yours, holger





More information about the Python-list mailing list