allowing braces around suites

Jeremy Bowers jerf at jerf.org
Wed Sep 1 12:03:32 EDT 2004


On Wed, 01 Sep 2004 06:13:09 +0000, Antoon Pardon wrote:

> If you need a function or class just to avoid nesting, then IMO
> you have only camoeflaged it.

If you are dividing your function merely on nesting grounds, you've missed
the point.

You'll find that if you do this correctly, you code more quickly, test
more easily, and after practicing for a couple of years you will never
again have the situation where you say to yourself "Gee, I'd really like
to use that functionality over there, but it is so wrapped up in other
extraneous garbage that it is easier to (do it from scratch/copy and
paste/live without it)."

If you're dissing it, you haven't tried it. Why don't you try it for a
while? Deeply nested functions are *bad*; continual use of them as an
employee of mine would be a firing offense (after suitable warnings), on
the grounds that code so produced has very limited worth compared to what
it should have. Deeply nested functions are harder to understand, harder
to debug, harder to re-use, harder to modify, harder to test, and all this
and no advantages, too!



More information about the Python-list mailing list