[Scummvm-devel] Residual's coding standards

Max Horn max at quendi.de
Sat Sep 18 13:09:03 CEST 2004


Am 12.09.2004 um 23:34 schrieb Kevin Harris:

>> From: Eugene Sandulenko <sev at interhack.net>
>> To: "Ori Avtalion" <oavtal at bezeqint.net>
>> CC: <scummvm-devel at lists.sourceforge.net>
>> Subject: Re: [Scummvm-devel] Residual's coding standards
>> Date: Sun, 12 Sep 2004 23:46:07 +0300
>>
>> Ori Avtalion writes:
>>  > I hereby propose changing residual's coding standards to those of
>>  > ScummVM, specifically the class member naming (_memberName as 
>> opposed
>>  > to memberName_).
>>  > It seems like a logical and sane step, and should be done before
>>  > the code drastically increases in size.
>> I second that. Having two different coding standards isn't very
>> convenient and makes switching between projects rather clumsy.
>>
>>  > Maybe a perl script could be written that regexp's the members and
>>  > reverses the underscores?
>> Manually it would be too much monkey's work.
>
> Care must be taken to ensure that the resulting identifiers are legal 
> (no identifier name begins with an underscore followed by an uppercase 
> letter, or two underscores).  All of this is for compliance with 
> section 17.4.3.1.2 of the C++ standard (reserved for the 
> implementation).

No problem -- our coding specs wouldn't allow either of those two 
anyway. I.e. "_Foo" and "__foo" are "wrong", we always use "_foo"...

>    There have been some reports about C++ compilers not accepting any 
> identifiers with leading underscores (I don't remember which, however, 
> and a quick search turned up no concrete results).

This may have been true for some old cfront based C++ compilers, but 
none of the compilers which are currently used to compile ScummVM have 
any such problems (obviously) so we need not worry about this :-)

> You could always do something ugly like prefixing a 'm' on the names 
> (eg. m_memberName), although I personally dislike this one. :)
>

See above: not necessary to do that.

Bye,

Max





More information about the Scummvm-devel mailing list