Another newbie design question

MartinRinehart at gmail.com MartinRinehart at gmail.com
Tue Dec 18 12:26:44 EST 2007


Sion Arrowsmith wrote:
> Given a one-or-the-other choice, any editor worth using can do
> "comment/uncomment region", and if only to-EOL comments are
> available, it will do that for you instead of using block
> comments. So block comments are not really a useful language
> feature.

I'd expect the complete beginner to start in Notepad, and stay there
for just long enough to realize that something better is needed.
region commenting might be the perfect reason for upgrading.

On the other hand, block comments are very useful for documentation.

On the other, other hand, commenting out a region as the editors do
makes it very obvious that the code is dormant.

On yet another hand, editors also colorize, so the commented-out
nature of block comments is apparent.

There are other options. We could borrow <code> and </code> from HTML
to have code and non-code regions. (In Java, where HTML is allowed in
the doc comments, I wanted my editor to toggle between HTML editing
and code editing. Not all wishes get fulfilled.)

I'd like to hear from people who use Python's multi-line strings other
than in doc comments.

> What would you have to say about a language which
> had no specialised comment syntax whatsoever, and expected
> you to use semantically irrelevent string literals?

I'd say the language predated Fortran, which means "Amazing" Grace
Hopper wrote it. Perhaps A-0 didn't have comments?



More information about the Python-list mailing list