A lot of people prefix member variables with m. Some use all sorts of prefixes to give clues about the types of different variables. Some use postfix_ for member variables, and some use postfix_ for parameters. Some people don't do any of this.
Generally I will prefix member variables with a m and that is it. Otherwise it just gets to confusing in my opinion to have a certain way of naming things for every single thing. If you are having to many of the same names that you start having to prefix/postfix everything with something you aren't giving good enough names in my opinion.
But no matter my opinion on the matter the only thing that really matters is you are consistent with whatever naming style you choose.
I prefix private member variables with m_
Basically so that if I encounter foo.m_bar or foo->m_bar it raises a red flag. It also helps to make using the variables in member functions unambiguous. Other than that I don't use any other form of prefix/postfix.
High level language... code to ensure correct cleanup... code to ensure correct copying... and most recently, code to ensure correct moving. Coming soon: a way to un-genericize templates! But I digress.
Some people don't do any of this.
This is what I currently do. I give short names to trivial variables, and reserve self-documenting names for fields and important variables, without adding useless decorations like trailing underscores or prefixes like "m_".
I understand that, but I think on large scale projects it just makes everything complicated. To this day I still don't truly understand winAPI simply because MS decided to use Hungarian notation like idiots.
I've never marked up my variables before. In the book I'm reading now, the author puts a trailing underscore on parameters which are used for initializing variables in the constructor.
1 2 3 4 5 6 7 8
class A;
class B {
A a;
public:
B(A a_) : a(a_)
{}
};
In my most recent project I started doing this. Then in one method, I had the thought that it might help readability to use this explicitly, but then I would have to do it everywhere and that's just ugly and a waste of tim, so I thought maybe I would use the m prefix, but I wanted to see what others think beforehand. I think I wont.