What do you use to denote a member variable in a class?
The most common time this is a problem is when you have a parameter passed into a constructor to set a member variable. Here is an example:
public MyClass(string name)
{
name = name; // arghh!!
}
I've used m_name before, but that stinks of Hungarian. I've used _name before, (I think I like that one best right now.) I've done the whole public MyClass(string n), to make the variable different, but that really stinks IMO. I've done the this.name before, but that seems burdensome to put everywhere you mention a member variable, and its hard to enforce.
Anyone have a good reason why one is better than another? Or what do you use?
This can be language agnostic.