🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.std.c
Article #2262

Re: comment style

#2262
From: Michael Condict
Date: Wed, 09 Jan 1991 05:07
36 lines
1940 bytes
In <17968:Jan804:38:1591@kramden.acf.nyu.edu>, brnstnd@kramden.acf.nyu.edu
(Dan Bernstein) writes:
 
>> However, as
>> another post points out, // comments can have there own pitfalls when
the line
>> ends with a '\'.
>
> No, not when they're done correctly. When you have end-of-line comments
> there's no need for continuation characters. *All* characters are
> ignored between // and newline inclusive.

This is an unwarranted generalization (that end-of-line comments
eliminate the need
for a continuation character), which doesn't really work in C.  For example, do
you really want to disallow the following?

	#define min_size 10  // Minimum size allowed for foo array
	#define max_size 20  // Maximum size allowed for foo array

Your proposal would require putting a blank line between the two #defines.
Also, you said that the comment would turn into a space, rather than simply
being deleted, which I agree is necessary in order to separate the token
preceding
it from the first token on the next line.  But then how do you get the
effect of:

	s = "123456789abcdefghijklmnopqrstuvwxyz\
	ABCDEFGHIJKLMNOPQRSTUVWXYZ";

using your comment notation?  Even assuming the comment delimiter is to be
recognized inside of quotes, a bad idea in itself, you would produce an
unwanted blank character in the string.

Michael Condict 
	
Technical Details
Message-ID: <1019@mururoa.imag.fr>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!bonnie.concordia.ca!uunet!mcsun!corton!imag!mururoa!mirabeau.osf.fr!condict
References: <17968:Jan804:38:1591@kramden.acf.nyu.edu> <613@caslon.cs.arizona.edu> <1050:Jan701:40:4791@kramden.acf.nyu.edu> <616@caslon.cs.arizona.edu>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!bonnie.concordia.ca!uunet!mcsun!corton!imag!mururoa!mirabeau.osf.fr!condict
From: condict@mirabeau.osf.fr (Michael Condict)
Newsgroups: comp.std.c
Subject: Re: comment style
Message-ID: <1019@mururoa.imag.fr>
Date: 9 Jan 91 05:07:35 GMT
References: <17968:Jan804:38:1591@kramden.acf.nyu.edu> <613@caslon.cs.arizona.edu> <1050:Jan701:40:4791@kramden.acf.nyu.edu> <616@caslon.cs.arizona.edu>
Sender: news@imag.fr
Reply-To: condict@mirabeau.osf.fr (Michael Condict)
Organization: OSF Research Institute
Lines: 36