I have seen too much C# and C++ code where the variable naming convention seems to ask programmers to write variable names using underscore before the text of the variable. e.gr.
int? _countMoney;
What's the rationale supporting that convention?
In C# I usually prefix with _
private fields but never local variables. The rationale behind this is that when I need a private variable I type _
and the Intellisense filters the list and it is easier to find. This way I am also able to distinguish between private from local variables and I no longer need to type this.variablename
for class fields but simply _variablename
.
It's just an easy way to identify private member variables.
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