approach to writing functions

Joe Mason joe at notcharles.ca
Tue Feb 10 13:08:05 EST 2004


In article <mailman.1398.1076388640.12720.python-list at python.org>, Terry Reedy wrote:
>> Just asking for a bit of guidance. If my program works, should it be
>> re-written to use functions or classes?
> 
> Working correctly is most important.  Next is running fast enough.  Then
> you can consider whether you or another person can read, edit, or reuse six
> months from now.  As for rewriting, would *you* gain some personal benefit
> from doing so?

Not true.  I would say being able to read, edit and reuse is most
important, then working correctly, then running fast enough.  Because
there are always going to be bugs that you don't find for a few months,
so even if you think it works correctly, you're probably wrong.  As for
working fast enough, being able to read the code makes it  much easier
to optimize it later IF you find out you have to.

Joe



More information about the Python-list mailing list