Naming Conventions
Naming Conventions
Abbrevation
CamelCase:
Use camel case as a general rule, or uppercase for very small words
Example:
strFirstName, dsetEmployees
.Conventions
Namespaces:
Pascal Case, no underscores. Use CompanyName.TechnologyName as root. If you don't have a company,
use your domain name or your own initials. Note that any acronyms of three or more letters should be
pascal case (Xml instead of XML) instead of all caps.
e.g
AppliedIS.TimeCard.BusinessRules
IrritatedVowel.Controllers
PeteBrown.DotNetTraining.InheritanceDemo
PeteBrown.DotNetTraining.Xml
Assemblies
If the assembly contains a single name space, or has an entire self-contained root namespace, name the
assembly the same name as the namespace.
e.g.
AppliedIS.TimeCard.BusinessRules.dll
IrritatedVowel.Controllers.dll
Pascal Case, no underscores or leading "C" or "cls". Classes may begin with an "I" only if the letter
following the I is not capitalized, otherwise it looks like an Interface. Classes should not have the same
name as the namespace in which they reside. Any acronyms of three or more letters should be pascal
case, not all caps.
e.g.
Widget
InstanceManager
XmlDocument
MainForm
DocumentForm
HeaderControl
Collection Classes
Follow class naming conventions, but add Collection to the end of the name
e.g.
Delegate Classes
Follow class naming conventions, but add Delegate to the end of the name
e.g.
WidgetCallbackDelegate
Exception Classes
Follow class naming conventions, but add Exception to the end of the name
e.g.
InvalidTransactionException
Attribute Classes
Follow class naming conventions, but add Attribute to the end of the name
e.g.
WebServiceAttribute
Interfaces
Follow class naming conventions, but start the name with "I" and capitalize the letter following
the "I"
e.g.
Iwidget
Enumerations
Follow class naming conventions. Do not add "Enum" to the end of the enumeration name. If
the enumeration represents a set of bitwise flags, end the name with a plural.
e.g.
Functions
Pascal Case, no underscores except in the event handlers. Try to avoid abbreviations.
e.g.
e.g.
e.g.
Procedure-Level Variables
Camel Case
e.g
int recordId ;
e.g
Controls on Forms
e.g
Constants
Follow black box conventions
SomeClass.SomePublicConstant
localConstant
_privateClassScopedConstant