approach to writing functions

Terry Reedy tjreedy at udel.edu
Tue Feb 10 14:41:17 EST 2004


"Joe Mason" <joe at notcharles.ca> wrote in message
news:slrnc2i5ut.7jp.joe at gate.notcharles.ca...
> In article <mailman.1398.1076388640.12720.python-list at python.org>, Terry
Reedy wrote:
> > 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 an not sure if programming philosophy is in the realm of true and false
;-)
I could be persuaded that points two and three might be reversed.

>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.

In a 100,000 line app, sure, there 'inevitably' will be behaviors less that
perfect.
But in the context of writing one page functions, I find this to be a
flabbergasting statement.  If the OP's example were to raise a syntax error
or other exception, or gather info about the wrong user, or gather
incorrect info, or email to the wrong address, or print instead of
emailing, then it would be useless and would need to be fixed now and not
months from now.

One can often expand the limits of 'correct' to include 'acceptible but
less than optimal' and maybe even 'occasional mysterious failure' (as with
Windows and Windows app crashes), but there are usually limits beyond which
one moves toward uselessness.

Terry J. Reedy







More information about the Python-list mailing list