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


RC 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?

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 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.")

How about: Experienced professional programmers have accidentally
commented out good code and accidentally left in bad code, causing
system failures.  We're planning to build mission-critical and
life-critical systems, so we want to eliminate that risk.


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

It can be less convenient.  One has to learn how to comment
appropriately in the new language, rather than just doing things
the same as in another language.  On the other hand, one has to
learn how to do MANY things differently.

Ada is relatively self-documenting, if coded properly.  With good
identifiers and code structure, I find that line-by-line comments
are largely self-defeating: they reduce the clarity of the
program by cluttering the listing.  Most of my comments are blocks
of text, describing what the following block of code is doing.

I do occasionally miss being able to close a comment, but I never
miss finding that some idiot has accidentally put a space between
'*' and '/', and the critical code following that comment isn't
compiled (but appears on the listing).  I especially don't miss
being the idiot.

Sam Mize




  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 ` 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
1997-07-03  0:00 ` Samuel Mize [this message]
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     ` Samuel Mize
1997-07-11  0:00     ` Joerg Rodemann
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
replies disabled

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