Path: 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 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