List:Internals« Previous MessageNext Message »
From:Michael Widenius Date:September 30 2010 4:01pm
Subject:[STYLE] could we allow // for comments alone on their line?
View as plain text  
Hi!

>>>>> "Guilhem" == Guilhem Bichot <guilhem.bichot@stripped>
> writes:

<cut>

Guilhem> I have always interpreted those rules the following way: this is permitted:

Guilhem> /* blah */
Guilhem> int x; // blih

Guilhem> but this is fordidden:
Guilhem> // blah
Guilhem> int x; // blih

Guilhem> I cannot find a good reason for this forbidding, and I find that the 
Guilhem> first form is less uniform than the second. I always need to remember 
Guilhem> that if there's no non-comment word on the line I need to use /* */ .

The main reason for this was that over time most single linke comments
that are alone one the line become multi line comments and then its
better to just have one comment syntax for these so that one doesn't
have to change things when extending a comment.

Personally I also find it easier to read if one has only one comment
syntax:

/*
  Comment line 1
  Comment line 2
*/
 code
/* comment */
code
/*
  Comment line 1
  Comment line 2
*/

Instead of mixing things:

/*
  Comment line 1
  Comment line 2
*/
 code
// comment
code
/*
  Comment line 1
  Comment line 2
*/

Regards,
Monty
Thread
[STYLE] could we allow // for comments alone on their line?Guilhem Bichot23 Sep
  • Re: [STYLE] could we allow // for comments alone on their line?Joerg Bruehe24 Sep
    • Re: [STYLE] could we allow // for comments alone on their line?Mats Kindahl24 Sep
      • Re: [STYLE] could we allow // for comments alone on their line?Mark Leith24 Sep
      • Re: [STYLE] could we allow // for comments alone on their line?Davi Arnaut25 Sep
        • Re: [STYLE] could we allow // for comments alone on their line?Mats Kindahl25 Sep
          • Re: [STYLE] could we allow // for comments alone on their line?Davi Arnaut26 Sep
        • Re: [STYLE] could we allow // for comments alone on their line?Guilhem Bichot27 Sep
          • Re: [STYLE] could we allow // for comments alone on their line?Martin Hansson28 Sep
          • Re: [STYLE] could we allow // for comments alone on their line?Davi Arnaut28 Sep
  • Re: [STYLE] could we allow // for comments alone on their line?Ingo Struewing24 Sep
  • [STYLE] could we allow // for comments alone on their line?Michael Widenius30 Sep