Originally posted by Bill Keller:
When I've seen underscores used, they suggest some pattern or intended meaning by convention.
While it is true that there is no inherent meaning in prepending underscores -- just as there is no
inherent meaning to all-caps -- there certainly is personal/group convention.
I've seen it used for the following.
Instance variable membersConstructor and setter argumentsAll method arguments (only saw this once) Personally, I dislike the practice for a couple reasons. First, the underscore is a PITA to type and easy to miss when reading code, and it looks ugly as a prefix/suffix. I did say "personally."
As well, modern IDEs can color-code member and local variables differently if you find you're getting confused. However, in that case I'd say the method is too long and/or not documented well enough.
For the majority (?) of people, using variable prefixes to denote scope and type has lost favor as OOP has gained in popularity. Nothing screams "exposed implementation details" like a variable named "mi_size".
In case we ever work together,
please don't pick up this style.