comp.lang.ada
 help / color / mirror / Atom feed
From: kwsodema@avistainc.com (Kenneth W. Sodemann)
Subject: Re: Ada's Assembly Language Comments
Date: 1997/07/03
Date: 1997-07-03T00:00:00+00:00	[thread overview]
Message-ID: <33bbbea9.8325807@news.mhtc.net> (raw)
In-Reply-To: y8xisHAeZ5uzYwIm@clanchy.demon.co.uk


On Thu, 3 Jul 1997 13:09:02 +0100, RC <rc1@clanchy.demon.co.uk> wrote:

>
>Why does Ada have only the " -- " assembly language style, in-line
>comments and not block structured ones as in C or Pascal or better still
>nested block structured comments as in Modula 2?
>

Why did the folks who defined Ada only define the one style of
commenting?  I cannot say, but I can speculate based on why, at the
company I work for, our C and C++ coding standards all but outlaw the
old /* .. */ comment style.

The " -- " (or " // " in the C/C++ world) style comments are "better"
(IMHO) for several reasons.  Most notably, they clearly define where a
comment starts, and ends, and it is almost impossible to "accidently"
comment out something.  In short, single like comments are safer.

The C and C++ coding standards where I work do not dis-allow the /* ..
*/ commenting style.  However, the coding standards _STRONGLY_ suggest
that the old fashioned C style comments _never_ be used for several
reasons.  All of the reasons given as notes in our coding standards
point to the fact that the newer " // " style comments are simply
safer.

/* For one thing, you do /* not have the problem where */
   this comment actually stopped on the previous line (though
   some C compilers can handle this). */

<WARNING:  Religious arguments ahead.>

Other reasons that the /* */ style comments are discouraged in our
C/C++ coding standards are that the // style comments are simply
prettier, and they make the comments stand out more.

ex:

//-------------------------
//  This is a comment on
//  several lines.
//------------------------- (a)

vs.

/*  This is a comment on
    several lines. */ (1)

or

/*-------------------------
    This is a comment on
    several lines.
-------------------------*/ (2)

or 

/*-------------------------
*   This is a comment on
*   several lines.
-------------------------*/ (3)

(1) would not stick out too well in actual code.
(2) is a slight improvement
(3) is even better, but at this point, you may as well used the //
style comments, which looked better in the first place.

This, of course, is more or less a religious argument, but I side with
the folks who state the (a) is the prettiest.

>There must be some opinions on this but the only justifications I have
>heard seem rather spurious.  (For example: "a student once had
>compilation problems when an open coment block went off the right hand
>of the screen with an editor which had line wrapping turned off.")
>

The flip side of this, of course, is what is so great about the "block
styled" comment delimiters?  I can think of no advantage.

>The elegance of user defined stucture of code seems to rather disappear
>with the "knife and fork" nature of these comments.
>

I do not under stand your "knife and fork" comment.  Please explain.

--
Kenneth W. Sodemann
kwsodema@avistainc.com
http://www.avistainc.com
Speaking for myself, _not_ AVISTA Inc.




  parent reply	other threads:[~1997-07-03  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 ` Peter Hermann
1997-07-03  0:00   ` Robert Dewar
1997-07-03  0:00   ` RC
1997-07-08  0:00     ` Peter Hermann
1997-07-03  0:00 ` Kenneth W. Sodemann [this message]
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 ` Samuel Mize
1997-07-04  0:00   ` Fergus Henderson
1997-07-07  0:00     ` Tucker Taft
1997-07-08  0:00     ` RC
1997-07-08  0:00   ` RC
1997-07-11  0:00     ` Stuart Palin
1997-07-11  0:00     ` Joerg Rodemann
1997-07-11  0:00     ` Samuel Mize
replies disabled

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