comp.lang.ada
 help / color / mirror / Atom feed
From: stt@houdini.camb.inmet.com (Tucker Taft)
Subject: Re: Ada's Assembly Language Comments
Date: 1997/07/07
Date: 1997-07-07T00:00:00+00:00	[thread overview]
Message-ID: <ECytIt.I88.0.-s@inmet.camb.inmet.com> (raw)
In-Reply-To: 5pj11i$364@mulga.cs.mu.OZ.AU


Why use "--" to introduce comments?

One little reason is that when you have large block comments,
you can do (line-oriented) searches and tell whether a given line 
found by your search is a comment line or not.  

With the C-ctyle /* ... */, or the #ifdef COMMENT_OUT ... #endif,
you may easily be confused by what is real code, and what is comment.

The biggest reason is readability.  There is never any doubt
what is a comment and what is not.

Interestingly, the only argument I have ever heard for
preferring the /* ... */ approach was to comment out large blocks
of code, but of course that only works if the large block
of code had no comments at all to begin with.

For what it is worth, when I write C, the only time I take advantage 
of the ability to stick a comment in the middle of a line of code
is to make up for the lack of named parameters when calling a function
(e.g. "do_sub(a, /* run_silent => */ true, /* run_deep => */ false);")

--
-Tucker Taft   stt@inmet.com   http://www.inmet.com/~stt/
Intermetrics, Inc.  Burlington, MA  USA




  reply	other threads:[~1997-07-07  0:00 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1997-07-03  0:00 Ada's Assembly Language Comments RC
1997-07-03  0:00 ` Samuel Mize
1997-07-04  0:00   ` Fergus Henderson
1997-07-07  0:00     ` Tucker Taft [this message]
1997-07-08  0:00     ` RC
1997-07-08  0:00   ` RC
1997-07-11  0:00     ` Joerg Rodemann
1997-07-11  0:00     ` Samuel Mize
1997-07-11  0:00     ` Stuart Palin
1997-07-03  0:00 ` Kenneth W. Sodemann
1997-07-04  0:00   ` Richard A. O'Keefe
1997-07-08  0:00     ` Kenneth W. Sodemann
1997-07-08  0:00   ` RC
1997-07-11  0:00     ` Dan Johnston D.B.
1997-07-13  0:00       ` Robert Dewar
1997-07-11  0:00     ` Robert Munck
1997-07-03  0:00 ` Peter Hermann
1997-07-03  0:00   ` RC
1997-07-08  0:00     ` Peter Hermann
1997-07-03  0:00   ` Robert Dewar
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox