approach to writing functions

Joe Mason joe at notcharles.ca
Tue Feb 10 20:17:56 EST 2004


In article <mailman.1429.1076442099.12720.python-list at python.org>, Terry Reedy wrote:
>>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.

I include misdesigns and lack of functionality here...  Apart from that
the ordering doesn't really matter for small functions because it's
trivial to be both clear and correct.

I thought we were talking about how to break down large apps into
functions, though - I didn't read teh original post closely enough.

Joe



More information about the Python-list mailing list