[Scummvm-devel] Residual's coding standards

James 'Ender' Brown ender at scummvm.org
Sun Sep 12 20:18:15 CEST 2004


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

I don't think you'll get any disagreement on this one.

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

This is also a valid point :)

Cheers,
	- Ender





More information about the Scummvm-devel mailing list