[haiku-development] Re: Final Set*UIColor Patch, Version 3e

  • From: Adrien Destugues <pulkomandy@xxxxxxxxx>
  • To: haiku-development@xxxxxxxxxxxxx
  • Date: Mon, 30 Nov 2015 06:56:07 +0100

On Mon, Nov 30, 2015 at 03:49:06AM +0100, Dario Casalinuovo wrote:

Il 29/nov/2015 19:36, "Adrien Destugues" <pulkomandy@xxxxxxxxx> ha scritto:

On Sun, Nov 29, 2015 at 06:22:07PM +0100, Dario Casalinuovo wrote:
"9852 : tab before comment to be removed"

Not according the style guidelines:


Ok then 90% of the code is broken :-)

We have two style of comments:
* Comment for a block of code goes above the block, and is not indented
further,

I've always used it in any case.

* Comments for a single line goes below the line, and is indented 1
level. (or, if the comment is short, directly to the right of the
line).

Good to know as I've been fixing both as a violation, but I can't see how a
comment below can improve readability.

I think this is rather well followed in our existing code.

I don't see the style so much respected especially for the single line
case. But I might be missing something, at least if a code block is meant
as an arbitrary set of lines or something more precise such as a function
or a loop.

I mean "code block" here as anything with more than one line.
The one-line case is rarely used, some cases where I would use it is for
commenting a complex regular expression or bit shifting pattern. These
fit in one line and sometimes deserve several lines of comments to
explain what is going on. This is used when the code is very "dense"
(lots of information on a single line), and it's a good thing that we
don't use it that much when the code is written in more readable ways.

--
Adrien.

Other related posts: