#959 – Don’t Use Double Underscores at the Start of an Identifier
October 24, 2013 2 Comments
When naming identifiers in C#, you can use the underscore (‘_’) character anywhere in the identifier name, including at the beginning of the name.
Some people use identifiers that begin with a single underscore for private fields (e.g. _name, _age). This use is no longer recommend. You should instead just use camelCasing for private fields. If you want to make clear that the identifer is a member variable, you can use the this keyword (e.g. this.name, this.age).
You should, however, never use a double underscore at the start of an identifier name. There are already several reserved keywords that start with a double underscore (e.g. __reftype, __refvalue). The double underscore notation is meant to be used for these reserved keywords and future revisions to C# may add new keywords that may then conflict with any identifiers that you have in your code.