C needs reliable comments

P E Smee exspes at gdr.bath.ac.uk
Fri Jan 18 20:57:31 AEST 1991


In article <14884 at smoke.brl.mil> gwyn at smoke.brl.mil (Doug Gwyn) writes:
>In article <2893 at cirrusl.UUCP> dhesi%cirrusl at oliveb.ATC.olivetti.com (Rahul Dhesi) writes:
>>(b) You can use #if 0 and #endif to comment out a block of code.  Then
>>if you have an invalid token or unbalanced quotes between these, the
>>"commented out" block of code, the compiler may abort compilation.
>
>This is fallacious.  If you start with valid code and "comment out" a
>section to leave valid code using #if 0 and #endif, there is no problem.
>If you wish to adopt the thesis that random character strings should be
>accepted as valid C program source code, you're even nuttier than we've
>come to expect from you.

Naw, I think he's proposing the hypothesis that there ought to be a way
for the programmer to assert 'this block is a comment, and it's none of
the compiler's business what is inside it'.  I've always wanted that,
as well.  It can be useful.  Particularly as one common reason for
wanting to comment blocks out is so you can begin debugging the bits
of a program which you think you have finished, while you're still
thinking about the bits that ought to be where you put the comment.

On the other hand, there IS a problem with his idea, still, which I've
pointed out in a response to his message.

-- 
Paul Smee, Computing Service, University of Bristol, Bristol BS8 1UD, UK
 P.Smee at bristol.ac.uk - ..!uunet!ukc!bsmail!p.smee - Tel +44 272 303132



More information about the Comp.std.c mailing list