[haiku-development] Re: coding style

  • From: "Axel Dörfler" <axeld@xxxxxxxxxxxxxxxx>
  • To: haiku-development@xxxxxxxxxxxxx
  • Date: Mon, 03 Mar 2008 12:55:46 +0100 CET

Marcus Overhagen <marcusoverhagen@xxxxxxxx> wrote:
> Axel Dörfler  <axeld@xxxxxxxxxxxxxxxx> wrote:
> > * use "char* variable" instead of "char *variable" in C++ code
> I disagree with that one. The * belongs to the variable, not to the
> type.
>
> I think we should use, depending of indention used:
> char *variable;
> and for column style indention
> char *          variable;
> but NOT
> char* variable;

From the language POV you'd be right, but the language is not
semantically clean here, and I don't think it makes sense to carry that
uncleanliness into our style guide. I especially don't like this hybrid
spacing you're suggesting, sorry. Tastes are just different.
Anyway, if we can't agree on something in particular, I think we should
just stick with the coding style we already have in that area, since we
have what we have.

> > * don't use ", fMyMember(...)" initializers (my greetings to Stippi
> > ;-
> > )), but "fMyMember(...),"
> Putting the the first ; and the , befor the variable looks nicer
> (and is easier to exend). I would really like to keep that style.

If you would change that list all day long, I would tend to agree, as
it's indeed slightly easier to work with. But since you don't do that,
and it looks odd in comparison to the rest, I see no reason to change
the existing style guide in this regard.

> another thing:
> I would like to have the opening curly bracket of a class or struct
> definition
> on the next line, as we do when defining functions:
>
> class Foobar
> {

You're kidding, right?
Anyway, if it gets to a vote, I think the votes should not be
distributed by head count, but by number of lines or commits in the
repository ;-)

Bye,
   Axel.


Other related posts: