Re^2: Why nested comments not allowed?

chris mcdonald chris at wacsvax.OZ
Fri Feb 16 16:42:37 AEST 1990


raw at math.arizona.edu (Rich Walters) writes:

>In article <236100027 at prism> ly at prism.TMC.COM writes:
>>
>>	I'm just curious to know why nested comments are not allowed in many 
>>	languages.

>Nested comments are not supported because it is difficult to tell where the
>nesting ends.  Have you ever written a paren checker in C? (in any language?)

>Reason 2) Why waste the computing power??  After all, it's only a comment!!

What a stupid response!
I don't know why they are not supported but agree that they are damn
useful. They are easy to parse in syntactically correct programs (ever
heard of counting?) and, after all, the computer/compiler is supposed to
do what we tell it, not for us to bow down and minimize its work.
If its really too hard for you to count comments I'll sell you a little
parser for a ridiculous amount.

--------------------------------------------------------------------------------
Chris McDonald.

Department of Computer Science,   ACSnet:   chris at wacsvax.oz
University of Western Australia,  ARPA:     chris%wacsvax.oz at uunet.uu.net
Mounts Bay Road,                  UUCP:     ..!uunet!murtoa!wacsvax!chris
Crawley, Western Australia, 6009. SDI:      (31.97 +/-10% S, 115.81 +/-10% E)
PHONE:  ((+61) 09) 380 2533       FAX:      ((+61) 09) 382 1688



More information about the Comp.lang.c mailing list