
2012/1/17 Johan Engelen <jbc.engelen@...2592...>:
- Underscore as first character of identifiers
Please consider that the C++ standard reserves _* identifiers [17.4.3.1.2]: "Each name that begins with an underscore is reserved to the implementation for use as a name in the global namespace".
Hmm, quite a large part of our codebase already uses _* to signify class members. I think this is somewhat common practice? Do we agree to ignore this text in the C++ standard? And shall we change our codestyle text to indicate that we use _* to indicate class members?
It means _* is allowed everywhere except the global namespace. It's not allowed for types, functions and global variables, but in the global namespace only. It's OK to have a function that starts with _ in the Inkscape or Geom namespaces.
Also reserved are all names that start with two underscores, and all names that start with an underscore and a capital letter, in all scopes. It's OK to have members like _data and _largeFoo, but not _Data or _Large_Foo. http://stackoverflow.com/questions/228783/what-are-the-rules-about-using-an-...
In my experience, underscores at the end are harder for the eye to 'parse', and look weird when the member itself is an object, e.g. object_.doSomething()
Regards, Krzysztof