A bit back we discussed and adopted the Google C++ Style Guide. As we dig
deeper into the C++ sources we find some striking differences in some of
the conventions that we may want to discuss and address before tackling
them.

*Variable Naming*
Google style dictates no *camelCase*, use either *alllowercase* or
*variable_name.
*Our C++ code has a mix of all three. Personally I prefer cameCase as more
readable.

*Class Data Members*
Google style says members must end with underscore, *my_member_*. While I
find this preferable to the common practice in our code of *m_* prefix,
like *m_myVariable,* I am not super fond of any decoration of member
variables.

*Constant Names*
Google says prefix with *k* and gives and example with *kCamelCase*. I
think *cameCase* might be a typo but again I am not fond of any variable
decorations.

*Reference vs. Pointer*
Google says use pointer if you intend to modify the value being passed and
use const references for values that are not going to be modified. It says
do not use references except for very limited use cases. We have references
and pointers spread inconsistently throughout the source. Worst, it is not
consistent in the public API. We should decide on a standard and make sure
our API adheres to it first.

Others may pop up as we go but these are the obvious ones standing out.

-Jake

Reply via email to