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

From: Silvan Jegen <s.jegen_AT_gmail.com>
Date: Thu, 27 Dec 2018 11:10:03 +0100

Hi

[2018-12-27 00:56] Martin Tournoij <martin_AT_arp242.net>
> 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?

I also prefer // (mostly because to insert those I can just do a block
insert in vim/vis). The only downside of //-style comments that I can
see is that they are only allowed since C99[0].

Maybe I am missing something too though.


Cheers,

Silvan

[0] https://en.wikipedia.org/wiki/Comment_(computer_programming)#C
Received on Thu Dec 27 2018 - 11:10:03 CET

This archive was generated by hypermail 2.3.0 : Thu Dec 27 2018 - 11:12:07 CET