[haiku-development] Re: coding style

  • From: "Michael Lotz" <mmlr@xxxxxxxx>
  • To: haiku-development@xxxxxxxxxxxxx
  • Date: Mon, 03 Mar 2008 13:32:09 +0100

> "Michael Lotz" <mmlr@xxxxxxxx> wrote:
> > This is really the one thing I also disagree. For one thing it 
> > simply 
> > looks ugly to me to have the * or & attached to the type, but this 
> > is 
> > a 
> > preference with no real technical basis. BTW I could agree to "char
> > *
> > ", 
> > but it gets funny when you specify "const char*" or even "extern 
> > const 
> > char*". It looks inconsistent to me to have spacing between the 
> > "const" 
> > and the "char" and then not between the "char" and the "*". Of 
> > course 
> > you cannot write "constchar*", but for me it looks more natural to 
> > be 
> > consequent and have all the parts of the type separated by spaces 
> > which 
> > results in "const char *".
> Think of "const" and "static" as attributes or qualifiers to the type 
> "char*" itself if that helps.

It doesn't, as I think of "*" as a qualifier or attribute to "char" ;-

Anyway, as we simply do not agree, it is pretty pointless to argue over 
it. As we disallow the double variable declaration "char *variable1, *
variable2;" per the style guide as well, there is nothing technically 
preventing either style. The question is how do we proceed from here? 
Should we cast a vote or do we simply agree on the compromise you 
proposed and write that down to the style guide? I think one can get 
used to pretty much everything, so I can live with "char*" as well (but 
I still find it ugly :-)).


Other related posts: