C commenting style?

Derek Atkins warlord at MIT.EDU
Mon Feb 4 12:24:45 EST 2008


Hi,

I prefer style 4 or style 5.  I HATE style 2.  Style 3 is bad.
Style 1 is okay.  Style 6 should be avoided.

Also keep in mind that there are multiple types of comments.  When
making a doxygen comment I defintiely prefer style 5:

 /**
  * Comment 1
  * Comment 2
  */

-derek

"Charles Day" <cedayiv at gmail.com> writes:

> What is GnuCash's preferred format for adding multi-line comments within the
> code of a C function?  From reading the code, I see a variety of styles
> currently in use, among them:
>
> --- Style 1 ---
> /* comment line 1
>  * comment line 2 */
>
> --- Style 2 ---
> /* comment line 1
>    comment line 2 */
>
> --- Style 3 ---
> /* comment line 1 */
> /* comment line 2 */
>
> --- Style 4 ---
> /* comment line 1
>  * comment line 2
>  */
>
> --- Style 5 ---
> /*
>  * comment line 1
>  * comment line 2
>  */
>
> --- Style 6 ---
> // comment line 1
> // comment line 2
>
> My personal preference has always been style 6, because it's easier to type
> and to read, but I'm happy to use use whatever. I want to add a bunch of
> comments to the code so please let me know what the "official" style is, if
> there is one. If the answer is "it depends", then at least tell me which
> styles to definitely avoid.
>
> Cheers,
> Charles
> _______________________________________________
> gnucash-devel mailing list
> gnucash-devel at gnucash.org
> https://lists.gnucash.org/mailman/listinfo/gnucash-devel
>
>

-- 
       Derek Atkins, SB '93 MIT EE, SM '95 MIT Media Laboratory
       Member, MIT Student Information Processing Board  (SIPB)
       URL: http://web.mit.edu/warlord/    PP-ASEL-IA     N1NWH
       warlord at MIT.EDU                        PGP key available


More information about the gnucash-devel mailing list