C++ naming: read_input() vs. readInput()
This is all very subjective, but generally for C++ I do:
camelCase
for functions and variables.
PascalCase
for classes.
public:
protected:
private:
In classes.
Edit: Forgot these 2:
Yes, friend
at the end, typedef
either at the beginning if they are used in the class, or after if they use the class (for obvious reasons).
I usually respect the traditions of the platform/environment I'm programming in, except on multiplatform C/C++ projects where I'm neutral. When programming C++ for Win32 platform, I tend to use the hungarian-notation for variables (type or semantic-prefixes). When programming MFC m_ member variables, etc. The only thing that I cannot get easy in my eyes is the Unix/POSIX open_device_driver
convention versus openDeviceDriver
camelcase style.
I prefer to take the boost route, and match the standard library. That means lower_case_names
. I like that my code reads consistent with respect to the STL.