[Scummvm-devel] Residual's coding standards

Kevin Harris gopickyournose at hotmail.com
Sun Sep 12 14:36:00 CEST 2004


>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).   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).

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

-Kevin-

_________________________________________________________________
Get ready for school! Find articles, homework help and more in the Back to 
School Guide! http://special.msn.com/network/04backtoschool.armx





More information about the Scummvm-devel mailing list