Re: [dev] Coding style: why /* */ and not //?

From: Hiltjo Posthuma <hiltjo_AT_codemadness.org>
Date: Wed, 26 Dec 2018 20:46:29 +0100

On Thu, Dec 27, 2018 at 12:56:29AM +1300, Martin Tournoij wrote:
> The coding style says:
>
> > Use /* */ for comments, not //
>
> Don't want to start a discussion about it, but I'm curious why // is
> disallowed? AFAIK all compilers accept // these days, and have for a
> long time?
>
> I've always preferred // since they can nest (you can comment out a
> function with //-style comments, but not with /* */-style comments), but
> maybe I'm missing a downside of //-style comments?
>
> Thanks,
> Martin
>

// is not ANSI.

I use /* */ and #if 0 for large blocks containing nested /* */ myself.

-- 
# Kind regards,
<!-- Hiltjo -->
Received on Wed Dec 26 2018 - 20:46:29 CET

This archive was generated by hypermail 2.3.0 : Wed Dec 26 2018 - 20:48:07 CET