What are the naming convention for private fields in c#.
Especially the discussion if a private fields must have a prefix like a underscore. The Design Guidelines from Microsoft are not clear in this. In the examples of Microsoft you find with and without underscores...
Why use underscore?- Never the same variables as parameter and field:
Code:private void Test(string text)
{
this.text = text;
//or
_text = text
}
why not use underscore?- When selecting a code line you sometimes don't see the underscore.
What do you thing?
Robert de Wolff - ADP Core Team