Re: Coding Style
On Mar 31, 12:14 am, Ian Collins <ian-n...@hotmail.com> wrote:
Ioannis Vranos wrote:
Hal Vaughan wrote:
And here's the part I'm curious about. It seems to me that
more recent code seems to have the Java influence and is a
bit more focused on readability, so it's more like this:
getVal()
loadConfig()
Actually the last is the "camel" style. It goes like GetVal() for
functions and someVal for variables.
Or getVal() for functions, someVal for variables and SomeClass
for classes.
Style varies between shops, with some influence from the
platform (GetVal() for functions appears to be common on
windows).
First, it's getValue() and loadConfiguration(). Modern
conventions eschew obfuscating abbreviations. Beyond that, it
probably depends on the ultimate source of the convention.
(Microsoft didn't invent anything here.) CCITT (one important
source for CamelCase), for example, used the convention that
typenames start with a capital letter, everything else with a
small. Convensions which have been taken over from earlier,
non-OO languages, where you don't have user defined types, might
very well adopt the convention of functions with a capital
letter, since they don't have any other important distinction.
(IMHO, the distinction between types and non-types is primordial
in C++, since it affects how a statement is parsed.)
--
James Kanze (GABI Software) email:james.kanze@gmail.com
Conseils en informatique orient=E9e objet/
Beratung in objektorientierter Datenverarbeitung
9 place S=E9mard, 78210 St.-Cyr-l'=C9cole, France, +33 (0)1 30 23 00 34