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/11 Message-ID: <33C675B0.5F8B@link.com>#1/1 X-Deja-AN: 256209621 References: <33BBD7AC.286F@link.com> Organization: Hughes Training Inc. Reply-To: smize@link.com Newsgroups: comp.lang.ada Date: 1997-07-11T00:00:00+00:00 List-Id: 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;