Re: Syntax of Comments (was: language design tradeoffs)

jlg@cochiti.lanl.gov (Jim Giles)
Wed, 23 Sep 1992 21:30:31 GMT

          From comp.compilers

Related articles
language design tradeoffs kotula@milli.cs.umn.edu (1992-09-07)
Syntax of Comments (was: language design tradeoffs) crowl@jade.cs.orst.edu (1992-09-21)
Re: Syntax of Comments (was: language design tradeoffs) moss@cs.umass.edu (1992-09-23)
Re: Syntax of Comments (was: language design tradeoffs) firth@sei.cmu.edu (1992-09-23)
Re: Syntax of Comments (was: language design tradeoffs) tmb@arolla.idiap.ch (1992-09-23)
Re: Syntax of Comments (was: language design tradeoffs) jlg@cochiti.lanl.gov (1992-09-23)
Re: Syntax of Comments (was: language design tradeoffs) jimc@tau-ceti.isc-br.com (1992-09-24)
Re: Syntax of Comments (was: language design tradeoffs) crowl@jade.cs.orst.edu (1992-09-24)
Re: Syntax of Comments (was: language design tradeoffs) crowl@jade.cs.orst.edu (1992-09-24)
Re: Syntax of Comments (was: language design tradeoffs) beshers@hks.com (1992-09-24)
Re: Syntax of Comments (was: language design tradeoffs) macrakis@osf.org (1992-09-24)
Re: Syntax of Comments (was: language design tradeoffs) fjh@munta.cs.mu.OZ.AU (1992-09-24)
[9 later articles]
| List of all articles for this month |
Newsgroups: comp.compilers,comp.human-factors
From: jlg@cochiti.lanl.gov (Jim Giles)
Organization: Los Alamos National Laboratory
Date: Wed, 23 Sep 1992 21:30:31 GMT
References: 92-09-048 92-09-134
Keywords: parse, design

crowl@jade.cs.orst.edu (Lawrence Crowl) writes:
> I dislike the `ifdef' approach to commenting out code for one very simple
> reason --- I can't tell by looking at a piece of code that it is commented
> out. I have to look up the next for an `ifdef'. When every commented
> line is marked clearly as being commented, then I can concentrate more
> locally.


Good point. On the other hand, the alternative I was arguing against was
using a single set of comment markers to comment out a whole block of
code. This uses that fact that (in those languages I was arguing against)
that comments must be explicitly terminated and don't end on the line they
begin on. In such a case, you have the same visibility problem as you
complained of with ifdefs.


Now, comments which begin with some marker and end with an EOL permit code
to be commented out by placing the markers along the left margin of the
code to be elided. This is very visible locally.


|> [...]
|> These issues were all addressed in the Ada Language Rationale. I've found
|> Ada's comment syntax to be the best of any common language that I've used.


Yes, Ada is one of the languages which adopted the guidlines I was giving
with respect to comments.
--
J. Giles
--


Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.