It seems that the most common naming convention for class instance attributes these days (from C++ books) is the trailing underscore. When did this style become the "fashion" leader?
What member data naming convention are folks using for their C++ production software?
for classes:
CamelCase, usually public methods (or properties in C# or similar);
camelCase, usually fields or private methods (except in Java, where this
is often the case for methods in general).
"z_" or "Z_" usually a "don't use" prefix (means this name is internal,
so avoid using even if public, as it is probably public due to technical
reasons...).
I usually don't distinguish between static/non-static fields or methods
(hadn't thought of it).
CamelCase is also used for class names, and ICamelCase often for
interfaces (or abstract base classes).
I may use:
something_subname
for fields or methods if there are a bit too many, or they are unrelated
or are a single conceptual unit.
sometimes a suffix such as "_f" is used for function pointers and similar...
in C and for top-level functions (I don't often use namespaces, as they
clash with my auto-header tools):
LIBRARY_CapsFirst, internal functions, library-specific;
LIBRARY_Component_CapsFirst, internal functions, component specific.
generally, it is ill-advised to use functions with the above naming
(they are internal APIs).
library_alllowercase
library_component_alllowercase
library_camelCase
....
is usually used for top-level variables (generally to be avoided if
possible) and also for library utility functions or often static-inline
functions. sometimes with the above, special suffixes such as "_r" or
similar are used to indicate special behavior ("_r" is typically a
recursive function).
I don't use public global variables, as this is nasty, so all shared
globals either need to be imported explicitly, or more typically
accessed via API calls...
libCamelCase, is typical for public API functions.
or such...