comp.lang.ada
 help / color / mirror / Atom feed
From: Samuel Mize <smize@link.com>
Subject: Re: Ada's Assembly Language Comments
Date: 1997/07/11
Date: 1997-07-11T00:00:00+00:00	[thread overview]
Message-ID: <33C675B0.5F8B@link.com> (raw)
In-Reply-To: rNu0QUAYEowzYwIF@clanchy.demon.co.uk


RC,

I don't have some bizarre need to make you agree with the Ada
design decision, I'm just explaining the rationale behind it.

In many cases, I agree, block comments would make code easier
to write, and sometimes easier to read.  Line-delimited comments
are better for detecting editing errors.  (I believe it was
a requirement for the competing language designs that EOL end
comments.)  Agreed, this problem is greatly reduced if your
language tracks level of comment nesting, but it isn't
completely eliminated.

Since commenting is commonly used to switch blocks of code
in/out for testing or incremental deliveries, there is some
readability benefit to ensuring that each LOC is flagged if
it's commented out.

Both of these have caused real problems on real projects.

But I personally don't consider it an issue worth a lot of
sweat in any case.  As long as you don't have C-style "on/off"
commenting, you're MUCH safer.  Blocks would be a little
easier for explanatory comments, and a little more hazardous
for use during test.

Relative to the following quote, do bear in mind that I'm talking
about detecting editing accidents, not an intentional coding style.

Sam Mize

RC wrote:
> Samuel Mize wrote:
> 
> >Ada was designed for building highly-reliable, mission-critical
> >systems.  They had seen accidentally-unclosed comments consume
> >code up to the next comment termination.  They had also seen live
> >code accidentally "hidden" by comments, e.g.:
> >
> >   text of C program appears  /* COMMENT BLOCK */
> >   to be over here on the     /* COMMENT BLOCK */ surprise!
> >   left side of the listing   /* COMMENT BLOCK */
> >
> >Requiring matching open/close tokens (as C does not) solves the
> >first problem, but not the second.
> 
> The second problem isn't one really is it?
> 
> If a program is written:
> 
>    put (text); new_line;
> 
> No one would doubt that the new_line was an active statement.
> 
> (*
>     A block of comments followed by code
>     would be rather a messy style,
>     but the meaning is apparent.
> *)                                                     new_line;




  parent reply	other threads:[~1997-07-11  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   ` RC
1997-07-08  0:00     ` Peter Hermann
1997-07-03  0:00   ` Robert Dewar
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     ` Joerg Rodemann
1997-07-11  0:00     ` Samuel Mize [this message]
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     ` Robert Munck
1997-07-11  0:00     ` Dan Johnston D.B.
1997-07-13  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