Title here
Summary here
Camel Case (camelCase) | In this standard, the first letter of the word always in small letter and after that each word starts with a capital letter. |
---|---|
Pascal Case (PascalCase) | In this the first letter of every word is in capital letter. |
Underscore Prefix (_underScore) | For underscore ( _ ), the word after _ use camelCase terminology. |
Hungarian Case | The data type as prefix is used to define the variable by developers long ago. Examples: string m_sName; string strName; int iAge; |
HtmlHelper htmlHelper;
FtpTransfer ftpTransfer, fastFtpTransfer;
UIControl uiControl, nextUIControl;
Naming convention is unaffected by modifiers such as const, static, readonly, etc.
Identifier | Casing | Example |
---|---|---|
Namespace | Pascal | namespace System.Security { // ... } |
Type | Pascal | public class StreamReader { ... } |
Interface | Pascal | public interface IEnumerable { ... } |
Method | Pascal | public virtual string ToString() { ... } |
Property | Pascal | public string Name { get { ... } } |
Event | Pascal | public event EventHandler Exited; |
Public Field | Pascal | public static readonly TimeSpan InfiniteTimeout; |
Public Const | Pascal | public const Min = 0; |
Private Field | _underScore | private string _url; |
Enum Value | Pascal | public enum FileMode { Append, ... } |
Parameter | Camel | public static int ToInt32(string value); |
PascalCase | camelCase | Incorrect Format |
---|---|---|
BitFlag | bitFlag | Bitflag |
Callback [1] | callback | CallBack |
Canceled | canceled | Cancelled |
DoNot | doNot | Don’t |
Endpoint [1] | endpoint | EndPoint |
FileName | fileName | Filename |
Gridline [1] | gridline | GridLine |
Hashtable [1] | hashtable | HashTable |
Id | id | ID |
Indexes | indexes | Indices |
LogOff | logOff | LogOut |
LogOn | logOn | LogIn |
Metadata [1] | metadata | MetaData |
Multipanel [1] | multipanel | MultiPanel |
Multiview [1] | multiview | MultiView |
Namespace [1] | namespace | NameSpace |
Ok | ok | OK |
Pi | pi | PI |
Placeholder | placeholder | PlaceHolder |
SignIn | signIn | SignOn |
SignOut | signOut | SignOff |
UserName | userName | Username |
WhiteSpace | whiteSpace | Whitespace |
Writable | writable | Writeable |
Footnote
[1] These are what are called closed-form compound words and should be treated as a single word. If you would write it as a single word in a sentence, do so in an identifier as well.
// Bad
class Person {
public int age { get; set; }
public int Age { get; set; }
}