For those of you who name you member variables with no special notation like m_foo
or foo_
, how do you name parameters to your ctors and setters?>
I do it like this:
obj(int foo) : _foo(foo) { }
int foo() const { return _foo; }
void foo(int value) { _foo = value; }
The only trick here is to make sure that the letter following the underscore is lowercase. However, I avoid uppercase in identifier names everywhere, as it is inconsistent with conventions used by the standard library (which uses foo_bar_baz
for all identifiers).