Article View: comp.lang.misc
Article #6323Re: language commenting constructs
From: Michael Golan
Date: Fri, 17 Mar 1989 16:36
Date: Fri, 17 Mar 1989 16:36
39 lines
1605 bytes
1605 bytes
Nested comments ? what that piece of code:
/**
printf("/* comment");
**/
How do you overcome such problems using FSM, or any parser ?
I think the "right" solution is to use the language smartly. if you don't
use
/*************** COMMENTED OUT
stuff ...
**************** END ****/
(or #if etc), you are stupid. It is just as easy to write hard-to-read code
with other constructions of the language (ANY language!). So what ?
x = 5 * (x == y<<1)? a:b ;
which is really
x= (5 * ( (x==y)<<1 ) )? a:b ;
(No flames pls if I got it wrong!)
At least for me, I had more problems with the above than with comments.
Languge is just a tool. It is a complex tool and hence non-perfect one. You
must use it wisely. Language designers can not predict bad ways of using
the language they design. One fortune I have seen read like that:
"Nothing can be made foolproof because idiots are such ingenious:"
One more note about "C" comments:
int x,*y ;
x=x/*y ; this is commented out */ ;
Michael Golan
mg@princeton.edu
Technical Details
Message-ID:
<15727@princeton.Princeton.EDU>Path:
arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!rutgers!njin!princeton!notecnirp!mgReferences:
<7555@killer.Dallas.TX.US> <10581@lanl.gov>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!rutgers!njin!princeton!notecnirp!mg From: mg@notecnirp.Princeton.EDU (Michael Golan) Newsgroups: comp.lang.misc Subject: Re: language commenting constructs Message-ID: <15727@princeton.Princeton.EDU> Date: 17 Mar 89 16:36:35 GMT References: <7555@killer.Dallas.TX.US> <10581@lanl.gov> Sender: news@princeton.Princeton.EDU Reply-To: mg@notecnirp.UUCP (Michael Golan) Organization: Dept. of Computer Science, Princeton University Lines: 39