TICS Coding Standard Viewer 
TIOBE Software Quality Framework
Print-friendly version
©TIOBE Software www.tiobe.com
 
C# Coding Standard
Search

Rule:  3@102Checked automatically with code checker

This rule is Obsolete
Synopsis:Use Pascal and Camel casing for naming identifiers
Language:C#
Severity Level:9
Category:Naming


Description:

In Pascal casing the first letter of each word in an identifier is capitalized, e.g., BackColor

In Camel casing only the first letter of the second, third, etc. word in a name is capitalized; for example, backColor.

The table below provides the casing for the most common types.
However beware of the following:

  • Words in all UPPERCASE, like e.g. DICOM, are a subset of Pascal casing and are therefore in principle allowed.
  • However try to limit this to often used and/or well-known acronyms, like DICOM, PACS, PII, ...
  • Also try to limit usage of this to enum values, const and/or read-only fields, variables and namespaces, unless good reasons exist to do so elsewhere.

IdentifierCaseExample
ClassPascalAppDomain
Enum typePascalErrorLevel
Enum valuesPascalFatalError
EventPascalValueChange
Exception classPascalWebException
FieldcamellistItem
Const FieldPascalMaximumItems
Read-only Static FieldPascalRedValue
InterfacePascalIDisposable
MethodPascalToString
NamespacePascalSystem.Drawing
ParametercameltypeName
PropertyPascalBackColor