Style question...

Peter Hansen peter at engcorp.com
Thu Aug 28 08:50:52 EDT 2003


"U. N. Owen" wrote:
> 
> For the moment I work on (a small part of) a project
> that has hundreds of thousands of lines, almost
> eveything in Python (and some in C and Fortran),
> and when you have a loop several pages long, or
> nested blocks to 8 levels or more, I may say
> it's *very* convenient to see where the end
> of a block exactly is. It's convenient to
> have some long variable names too.

I use Scite, which provides a graphical means of representation
the indentation, with vertical lines that extend down at every
indent level.  (It would have to be later in the day for me to
be coherent enough to describe it better.)  Suffice to say that
it provides more than adequate (for me) visual indication of the 
end of a block that stretches too far.

A better point I'd make however is that if you have a loop several
pages long, or a nested block 8 levels deep, the code needs
refactoring!  Saying this occurs in a large project does nothing
to excuse it: the more code you have, the greater the need for
structuring it well.

-Peter




More information about the Python-list mailing list