Article View: comp.lang.misc
Article #6322Re: language commenting constructs
From: Robert Firth
Date: Fri, 17 Mar 1989 14:14
Date: Fri, 17 Mar 1989 14:14
43 lines
1732 bytes
1732 bytes
One of the things I've wanted to do in almost any of the
programming languages I've used, is comment out in a simple
way a fairly large piece of code, without having to worry
about whether that code itself contains comments.
There are three ways to do this with which I'm familiar
(a) Have a comment introduced by a sentinel and terminated
by end-of-line. One then comments out by inserting
the sentinel in front of every line:
C Debugging code commented out
C
CC Print current value of chipmunk queue
C
C CALL CHQPNT(CHQ)
Most editors have an easy way to do this.
(b) Have comments introduced and terminated by paired sentinels
that strictly nest:
{ BEGIN Debugging code commented out
{ print current value of chipmunk queue }
chipmunk queue print ( chipmunk queue );
Debugging commented out code END }
(c) Use line comments normally and reserve block comments for
commenting out:
/* Debugging code commented out
// print current value of chupmunk queue
ChQ.Print(ChQ)
*/
All of these seem to work moderately well; in a language that permits
none of them I sometimes get very frustrated!
Technical Details
Message-ID:
<8825@aw.sei.cmu.edu>Path:
arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!csd4.milw.wisc.edu!bbn!rochester!pt.cs.cmu.edu!sei!sei.cmu.edu!firthReferences:
<Mar.11.18.24.04.1989.18285@athos.rutgers.edu> <1543@zen.UUCP> <12362@watdragon.waterloo.edu>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!csd4.milw.wisc.edu!bbn!rochester!pt.cs.cmu.edu!sei!sei.cmu.edu!firth From: firth@sei.cmu.edu (Robert Firth) Newsgroups: comp.lang.misc Subject: Re: language commenting constructs Message-ID: <8825@aw.sei.cmu.edu> Date: 17 Mar 89 14:14:56 GMT References: <Mar.11.18.24.04.1989.18285@athos.rutgers.edu> <1543@zen.UUCP> <12362@watdragon.waterloo.edu> Sender: netnews@sei.cmu.edu Reply-To: firth@bd.sei.cmu.edu (Robert Firth) Organization: Carnegie-Mellon University, SEI, Pgh, Pa Lines: 43