When is an underscore used in C#?

By On Sunday, July 10th, 2016 Categories : Question & Answer

When is an underscore used in C#?. Are You mam and sir own that kind of uncertainty?, If do then please get the best tips right after below:

It is usually used as a prefix for private variable names as a visual indication that the scope of the variable is private to the class in which it is declared. It thereby increases readability.

It is a naming convention called ‘underscore notation’, as opposed to for example Hungarian notation  [1].

Microsoft’s programming guidelines do not include a naming convention for private members of a class and it is therefore optional to use any specific style for naming private members  [2]. However, using an underscore as a prefix in private variable names is widely adopted in C# [citation needed] and it is also the default naming convention used by the popular Visual Studio plugin ReSharper  [3].


[1] Variable names in C# Part 2

[2] Names of Type Members

[3] Why does Resharper rename variables to start with an underscore?

We at this web site hope if those answers listed above could solve your concern. Thank You So Much


skema zenfone z007, jalur memory andromax c, rom maxos andromax
When is an underscore used in C#? | SitusPanda | 4.5