.net Naming Conventions and Programming Standards

.net Naming Conventions and Programming Standards


Type

Example
Namespaces

AppliedIS.TimeCard.BusinessRules
IrritatedVowel.Controllers
PeteBrown.DotNetTraining.InheritanceDemo PeteBrown.DotNetTraining.Xml
Assemblies

AppliedIS.TimeCard.BusinessRules.dll
IrritatedVowel.Controllers.dll
Classes and Structs

Widget
InstanceManager
XmlDocument
MainForm
DocumentForm
HeaderControl
CustomerListDataSet (typed dataset) 
Collection Classes

WidgetCollection
Delegate Classes

WidgetCallbackDelegate
Exception Classes

InvalidTransactionException
Attribute Classes

WebServiceAttribute
Interfaces

IWidget
Enumerations

SearchOptions (bitwise flags)
AcceptRejectRule (normal enum)
Functions and Subs

C#: public void DoSomething(...)
Properties and Public * Member Variables

C#: public int RecordId
Parameters

C#: ref int recordId
Procedure-Level Variables

C#: int recordId ;
Class-Level Private and Protected Variables

C#: private int _recordId ;
Controls on Forms

"ux" prefix
uxUserIdField, uxHeaderLabel, uxPatientDateOfBirthField, uxSubmitCommand
 no "ux" prefix
LastNameField, LastNameLabel, SubmitCommand, NextPageNavigation
Constants

SomeClass.SomePublicConstant
localConstant
_privateClassScopedConstant
.net Naming Conventions and Programming Standards .net Naming Conventions and Programming Standards Reviewed by Bhaumik Patel on 10:32 PM Rating: 5