[TUHS] // comment in C++
scj at yaccman.com
Thu Feb 9 14:55:21 AEST 2017
Well, personally I use // for almost all comments in C/C++. I
reserve /* */ for commenting out blocks of code. Since, for some
reason, /* */ doesn't nest, if I stick to this style life is good.
----- Original Message -----
From: "Steve Nickolas" <usotsuki at buric.co>
To:"The Eunuchs Hysterical Society" <tuhs at tuhs.org>
Sent:Wed, 8 Feb 2017 21:47:49 -0500 (EST)
Subject:Re: [TUHS] // comment in C++
On Thu, 9 Feb 2017, Dave Horsfall wrote:
> On Wed, 8 Feb 2017, Steve Johnson wrote:
>> I remember some discussion about this. In reality, a C comment
>> requires you to type 8 characters, because putting anything
>> the /* or */ looks terrible. Many languages used single
>> (e.g., # for make). The argument was "if you make comments
>> type, you'll get more of them in the code" (viz. the Unix
>> guessing Bjarne was aware of these discussions, although I don't
>> remember specifically that he was...
> My favourite C /* */ style is this:
> * foo
> * bar
This is the way I usually write my comments, too.
> Is that what you meant? And recent C also accepts // as a comment,
> I use like this:
> * This is where we do some neat stuff.
> weird_function(); // Yes, we need to call this here...
> I'm quite taken by BIND, though, which accepts
> /* this */
> // this
> # and this.
Unrealircd likewise accepts those 3 different types of comments.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the TUHS