In our projects we decided to prefix member variables and some private/protected methods with underscore (so with “_
”).
During a discussion it was claimed that this is discouraged to do because of some incompatibilities with some compilers/linkers on some platforms. As we want to be a portable as possible I'd like to be sure.
I also reckon that prefixing globals with underscores in C can be a problem.
Does the same apply to C++-linkage and if so, in which cases (platforms/compilers/linkers)?
Personally, I use m_name
, with 'm' standing for 'member'.
By the way, I also use p_
for parameters in my functions and g_
for the few unavoidable globals.
(then I usually get bashed by SO users because it looks like Hungarian notation ;-) But it is not.)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With