C# Variable Naming Capitalization Styles Refresher from MSDN

Edit
LOGO, VB, Pascal, Java, Perl, ActionScript, PHP, JavaScript, CSS, C# --- There are too many language I have been programming with and each have their suggested naming convention. Every now and then I need to go back and look at how to properly name my variables and classes so as to conform to the standard of the language. And today, it's time to refresh on C# variable naming convention style!

The following table summarizes the capitalization rules and provides examples for the different types of identifiers.
IdentifierCaseExample
ClassPascalAppDomain
Enum typePascalErrorLevel
Enum valuesPascalFatalError
EventPascalValueChange
Exception classPascalWebException
Note   Always ends with the suffix Exception.
Read-only Static fieldPascalRedValue
InterfacePascalIDisposable
Note   Always begins with the prefix I.
MethodPascalToString
NamespacePascalSystem.Drawing
ParameterCameltypeName
PropertyPascalBackColor
Protected instance fieldCamelredValue
Note   Rarely used. A property is preferable to using a protected instance field.
Public instance fieldPascalRedValue
Note   Rarely used. A property is preferable to using a public instance field.
C# Variable Naming Capitalization Styles Refresher from MSDN C# Variable Naming Capitalization Styles Refresher from MSDN Reviewed by DF on 8:10:00 PM Rating: 5
©DF. Powered by Blogger.