Google C++ style guide

Justin Johansson no at spam.com
Sat Oct 3 18:34:53 PDT 2009


bearophile Wrote:

> >Regular Functions: Functions should start with a capital letter and have a capital letter for each new word. No underscores:<
> 
> That's ugly.

Coming from a career in acronym-city (aerospace), project management mandated that use of acronyms
in identifiers MUST be clearly indicated with uppercase letters.  In the event that ambiguity could arise, such as in camel-cased identifiers, the end of an acronym had to be separated by an underscore between it and any following letter in the identifier.

This rule, whilst painful/ugly at times, was rigorously enforced in safety critical systems lest there be
any possibility, no matter how remote, of confusion with interpretation of nomenclature in systems
engineering documents.

So, for example, the following were for verboten:

ParseXmlDocument    (The correct acronym for Xml is XML)
PaseXMLDocument     (XMLD might be erroneously interpreted as a 4 letter acronym)

Required formulation of the identifier in the case must be "ParseXML_Document".

Ciao
Justin Johansson




More information about the Digitalmars-d mailing list