- assigned_to: nobody --> marcsskyhunter
At 01:55 PM 2/3/2004 Tuesday, Constantine Plotnikov wrote:
Hi!
In my practice in C and Java, I have sometimes used
block comments to
comment part of expressions (mostly during debugging
where fixes should be
easily reversable or during code review where changes
should be explained).
For example:
// doubleValue() does not mean what is wanted in line below
obj.myMethod( a + 2 * b /* WAS: a + b.doubleValue() */,
"some text" /* FIXME: take it from app. properties*/)
This feature was quite useful and it could not be
replaced with line comments.
Here's how I cope with that without block comments:
# FIXME: take "some text" from app. properties
obj.myMethod( a + 2 * b, "some text")
# explanation of why we're not doing or would like to do:
# obj.myMethod( a + b.doubleValue(), "some text")
My convention is that, for commented out code, the "#"
occurs in the first
column. For other comments, the "#" follows the
program's indentation. The E
re-indenter built into eBrowser knows to leave "#"s in
the first column
alone, but to re-indent the rest along with the program.
If we did add block comments later, it would be an
upwards compatible
change, so this proposal remains on the table. By the
same token, we can
continue to postpone it. Personally, I think it's good
that E doesn't have
them.
At 06:41 AM 2/2/2004 Monday, Zooko O'Whielacronx wrote:
Perhaps it is a job for a tool to do. For example
XEmacs's Python-mode will
prepend "# " to each line in a block in order to
comment-out that block. It can
also un-comment-out a block. It works nicely.
IntelliJ does something similar, and it's wonderful. I
use it all the time.
eBrowser should eventually be enhanced to comment out
code by inserting "#"s
in the first column. Unlike "/*..*/"s, this way of
commenting out code nests
and unnests perfectly.