Hi, Alan,

On Jan 21, 2010, at 14:03 , Alan W. Irwin wrote:

> Certainly, the C99 standard supports the
> // style of comments in C code as does gcc.  Is anyone here aware of
> any modern C compiler that does not understand the // form of comment?

I certainly find the // comments convenient, but I recently ran into  
a small annoyance on a project with a manually maintained Makefile.   
I found that I needed to use the gcc compiler option...

-std=gnu99

...in order to be able to use // comments and some other "basics"  
like usleep and getopt.  Using just "c99" instead of "gnu99"  
apparently excludes some (commonly used, IMHO) functionality.  I  
presume that cmake would discover what the user's compiler requires  
in order to build the PLplot code, so I don't think this would be an  
issue for PLplot.

> For C code and the /*...*/ form of comment we have the choice of the
> asterisked form
>
> /*
>   * Some comments...
>   * More comments....
>   */
>
> or the unasterisked form
>
> /*
>    Some comments...
>    More comments....
>   */
>
>
> It turns out the choice between the two above styles is purely a  
> matter
> of style with no practical consequences.

Not quite, IMHO.  The former form (with leading asterisks on every  
line) offers a little more information to someone who is grepping  
through the code and gets one one line from a multi-line comment.   
The leading asterisk is a visual cue/clue that the line is from a  
comment.  It's amazing how some comments taken out of context this  
way can look like actual code!  :-)  Of course, this is perhaps yet  
another reason to go with // comments in the first place.

> I am currently experiencing a nasty emacs issue where if you  
> attempt to fill
> multi-line commentary to even out the right-hand side a bit, then  
> what were
> leading asterisks are scattered throughout the commentary text.  If  
> the
> emacs gurus here have no solution for this, then it provides a strong
> motivation for (3).

I can't help you with that specifically (I use Vim), but I suspect  
all major editors can deal with reflowing all kinds of comments once  
they are suitably "trained".

> I look forward to your further discussion on whether to move now to  
> the //
> form or wait on that and attempt instead to deal with the /*...*/  
> leading
> asterisk issue.

In the final analysis, I'm pretty agnostic about source code styles  
(including comments).  Different projects have different styles, so  
I've learned to adapt to the local customs.

When in Rome...

Hope this helps,
Dave


------------------------------------------------------------------------------
Throughout its 18-year history, RSA Conference consistently attracts the
world's best and brightest in the field, creating opportunities for Conference
attendees to learn about information security's most important issues through
interactions with peers, luminaries and emerging and established companies.
http://p.sf.net/sfu/rsaconf-dev2dev
_______________________________________________
Plplot-devel mailing list
Plplot-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/plplot-devel

Reply via email to