allowing braces around suites

Antoon Pardon apardon at forel.vub.ac.be
Thu Sep 2 07:38:55 EDT 2004


Op 2004-09-02, Isaac To schreef <iketo2 at netscape.net>:
>>>>>> "Antoon" == Antoon Pardon <apardon at forel.vub.ac.be> writes:
>
>    Antoon> If you need a function or class just to avoid nesting,
>    Antoon> then IMO you have only camoeflaged it. In order to
>    Antoon> understand what is going on you still need to understand
>    Antoon> how the nesting of a number of controls prroduce a certain
>    Antoon> result and when you write a function just to avoid nesting
>    Antoon> it often enough makes readablity harder.
>
> Splitting a deeply nested function in the wrong way can make a program
> harder to understand.  But that doesn't mean that in such case what
> you should do is to leave it as is.  It's the comparsion of something
> bad with something that is just as bad.  In either way that is bad:
> the program is easy enough to understand only by the original writer,
> and only at the instant when the code is written.

I think the respondent here are missing the point.

I have fond specific nested code which was easier to understand
when the nesting was ended by an endmarker then when it was not.

Now should I conclude that all such code is nested too deeply
and should be decomposed in subfunctions? Because that is the
impression I'm getting from the answers here.

Or is there a problem in accepting that such code exists?

Now if we accept that such code exists and it doesn't imply
the code is nested too deeply, I have the following question.

Python seems to do its best so that there is only one way to
do things. Python seems also to do its best force people
to write readable easily maintainable code. Since end markers
can be a tool in this and the only way to have only one way
to do this is if the language includes it, So why doesn't
python has them.

-- 
Antoon Pardon



More information about the Python-list mailing list