🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.std.c
Article #2284

Re: comment style

#2284
From: Stephen Clamage
Date: Sat, 12 Jan 1991 18:05
26 lines
1335 bytes
andrew@resam.dk (Leif Andrew Rump) writes:

>Just a single question: Does TC warn you about comment (/*) inside
>a comment (//)? If not then _I_ will never mix // and /**/ and maybe
>even abandon // completely!!!

Comments do not nest.  A // introduces a comment which extends *to*
(not through) the end of the line.  There is no problem in mixing the
two styles.  For example:

//	foo(bar);	/* I'm not sure if I want this call */

The entire line can be commented out by placing the // at the start, and
has no effect on any other code in the program.  Similarly:
/*
	foo(bar);	// for foo-ish systems
	fee(fie);	// for foo-ish or fee-sh systems
*/
The two line can be commented out with the /* */ even though they contain
//-style comments.

A consistent commenting style is helpful.  I use // for trailing inline
comments, and /* */ for block comments.
-- 

Steve Clamage, TauMetric Corp, steve@taumet.com
Technical Details
Message-ID: <550@taumet.com>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!bonnie.concordia.ca!uunet!taumet!steve
References: <4423@alliant.Alliant.COM> <10852@darkstar.ucsc.edu> <1991Jan11.155326.3125@resam.dk>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!bonnie.concordia.ca!uunet!taumet!steve
From: steve@taumet.com (Stephen Clamage)
Newsgroups: comp.std.c
Subject: Re: comment style
Message-ID: <550@taumet.com>
Date: 12 Jan 91 18:05:57 GMT
References: <4423@alliant.Alliant.COM> <10852@darkstar.ucsc.edu> <1991Jan11.155326.3125@resam.dk>
Organization: Taumetric Corporation, San Diego
Lines: 26