[phobos] Initial Phobos style guide proposal

Jacob Carlborg doob at me.com
Thu Mar 31 12:09:21 PDT 2011


On 31 mar 2011, at 20:39, Andrei Alexandrescu wrote:

> On 3/31/11 12:30 PM, Jonathan M Davis wrote:
>> On 2011-03-31 08:21, Jacob Carlborg wrote:
>>> class Foo
>>> {
>>>     int _foo;
>>> 
>>>     int foo () { return _foo; }
>>> }
>>> 
>>> But in that case I would still prefer to put the underscore after the name.
>> 
>> The current style used in Phobos is an underscore before the name.
> 
> This is the perfect example on why such discussions quickly devolve into counterproductive exchanges. There's hardly any objective reason for placing an underscore before or after a symbol, so we can go with "I like it that way" and "Well I like it the other way" forever. Please - let's stop.
> 
> I only see two ways out of this:
> 
> - We accept that one person decides;
> - We agree to not decide on it.
> 
> Regarding the number of columns, if that's bound to render people unhappy and less likely to contribute, absolutely no problem. Make it a loose guideline if at all.

I don't care if it's a leading or trailing underscore but I don't want to add an underscore when there's no reason, ie. no matching getter/setter.

> Andrei
> _______________________________________________
> phobos mailing list
> phobos at puremagic.com
> http://lists.puremagic.com/mailman/listinfo/phobos

-- 
/Jacob Carlborg



More information about the phobos mailing list