From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=0.2 required=5.0 tests=BAYES_00,INVALID_MSGID, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,2cd0b8b65b7d84fb X-Google-Attributes: gid103376,public From: Samuel Mize Subject: Re: Ada's Assembly Language Comments Date: 1997/07/03 Message-ID: <33BBD7AC.286F@link.com>#1/1 X-Deja-AN: 254293039 References: Organization: Hughes Training Inc. Reply-To: smize@link.com Newsgroups: comp.lang.ada Date: 1997-07-03T00:00:00+00:00 List-Id: 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