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=-1.3 required=5.0 tests=BAYES_00,INVALID_MSGID 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: kwsodema@avistainc.com (Kenneth W. Sodemann) Subject: Re: Ada's Assembly Language Comments Date: 1997/07/03 Message-ID: <33bbbea9.8325807@news.mhtc.net>#1/1 X-Deja-AN: 254435661 References: Organization: MPI-MHTC Internet Newsgroups: comp.lang.ada Date: 1997-07-03T00:00:00+00:00 List-Id: On Thu, 3 Jul 1997 13:09:02 +0100, 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? > 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). */ 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.