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
--
Return to the
comp.compilers page.
Search the
comp.compilers archives again.