Sujet : Re: Python (was Re: I did not inhale)
De : commodorejohn (at) *nospam* gmail.com (John Ames)
Groupes : comp.unix.shell comp.unix.programmer comp.lang.miscDate : 27. Aug 2024, 17:03:20
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <20240827080320.00003fd2@gmail.com>
References : 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
User-Agent : Claws Mail 4.2.0 (GTK 3.24.38; x86_64-w64-mingw32)
On Tue, 27 Aug 2024 15:10:08 +0200
David Brown <
david.brown@hesbynett.no> wrote:
(6) You want to add extra statements to the end of a block, but
where IS the end? You have to INFER the ending by looking for a
line with a smaller indent. But suppose you're at the bottom of a
window; is that bottom line the last in the block, or is there
another one at the same indent just out of sight? You have to
tentatively keep peeking ahead!
Keep your blocks small and neat.
That's very much one for the "good advice that is not always feasible
in the Real World" file. Every project has its own natural balance of
"large things that can be easily re-factored into sets of small things"
(i.e. things you can function-ize) vs. "large things that cannot."
(6a) And maybe there's big comment blocking in the middle of block;
comments don't need nesting! If there are lots of comments and few
statements, finding the end of the block (ie. the last statement of
this block) can become quite an exercise.
That applies to every programming language (unless you know of one
that doesn't support comments).
It applies very much moreso to languages where comments *must* follow
the indentation level of the surrounding code, so that the deeper you
go, the more lines you have to split comments across.