Article View: comp.lang.misc
Article #6315Re: language commenting constructs
From: Eric Green
Date: Thu, 16 Mar 1989 02:41
Date: Thu, 16 Mar 1989 02:41
36 lines
2103 bytes
2103 bytes
in article <10460@lanl.gov>, jlg@lanl.gov (Jim Giles) says:
> do otherwise. The comment syntax which requires explicit termination
> of comments _IS_ more difficult to learn to use safely. The safe
> use of the construct is also (marginally) more difficult in actual
> use. It is doubtful that anyone designing a new language would
> consider the old-fashioned C-like syntax to be desireable.
In a recent program, I have code similiar to the following: */
/* table */
int Transitions[NUMSTATE][NUMCLASS] = {
/* statenum digit number delimiter quote EOF EOL ... */
/* 0 */ 2, 5, 8, 15, 10, 19,
/* 2 */ 4, 19, ....
The languages in which I have programmed most are "C", Pascal,
various assembly languages, and Lisp/Scheme. The first two have
explicit terminators, the latter two make everything between a ";" and
EOL a comment. When I do assembler or Lisp I regularly run into
situations where I want to imbed a comment into a statement for
clarity's sake, and can't do it.
So it's sort of like the choice between using "C" and using a
higher-level language. "C" is more flexible and powerful for many
types of code (e.g. write a device driver in Prolog? Out of your
mind!). But that flexibility has a price -- it's a lot easier to make
mistakes. As far as language comment style is concerned, it's a matter
of wehther you want to pay the price for flexibility or not. If your
language is one that'll be used in high-risk situations -- e.g. Ada --
you might decide you DON'T want that flexibility.
--
| // Eric Lee Green P.O. Box 92191, Lafayette, LA 70509 |
| // ..!{ames,decwrl,mit-eddie,osu-cis}!killer!elg (318)989-9849 |
\X/
Technical Details
Message-ID:
<7555@killer.Dallas.TX.US>Path:
arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!ames!killer!elgReferences:
<10460@lanl.gov>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!ames!killer!elg From: elg@killer.Dallas.TX.US (Eric Green) Newsgroups: comp.lang.misc Subject: Re: language commenting constructs Message-ID: <7555@killer.Dallas.TX.US> Date: 16 Mar 89 02:41:09 GMT References: <10460@lanl.gov> Organization: The Unix(R) Connection, Dallas, Texas Lines: 36