dagbrown
11/12/2003 4:37:00 PM
In article <Pine.LNX.4.33.0311100952070.17966-100000@as0203.cs.uni-dortmund.de>,
Artur Merke <merke@ls1.cs.uni-dortmund.de> wrote:
: Hi,
:
: some time (years ;-) ago there was a discussion about multi line comments
: in ruby on this list. I didn't follow it completely, just found it in
: news.google. There were sth. about 60 postings but AFAIK today (and it is
: 2 years later!) there is still no other way to make multi line comments
: in ruby then the cumbersome
:
: =begin
: ...
: =end
:
: block? Is this right, or have I simply missed something?
:
: IMHO a simple c/c++ style comment
:
: /*
: ...
: */
:
: is missing in ruby!
No great loss. (I know, I know, I sound like one of those
annoying people who say "no, you don't NEED features and
functionality!", but bear with me here.)
If you ever go through lots of C code, you'll probably notice that
most multiline comments--at least those written in code by good
programmers who have to work with other people--you'll probably
notice this:
/* Multiline comments have a row of stars down the left hand side
* of the comment block so that the comment stands out from the
* rest of the code. Heck, my text editor (vim) automatically put
* these stars in for me.
*/
I have a sneaky feeling that "use a text editor that cooperates
with you" addresses another issue that you'd have with the lack of
multi-line comments--it's harder to type them in and reformat them
when you have to keep worrying about the '#' marks everywhere.
Fear not! A decent code editor will worry about that for you.
Also, it's nice to have an easy way to do one-liner comments;
witness the fact that C++'s "//" is now a standard comment
character in the C99 standard.
At least it's not a capital C in the first column.
Now, because Matz provides features (and you use them), you do
still have =begin/=end, but I usually use those for embedded-
documentation things rather than for comments. Personally, I
prefer to have comments that are obviously comments, even when I'm
not using a syntax-highlighting editor. Perhaps your text editor
is cooperating too well with you? :-)
--Dave