Code Style and Naming Guide
We are using spaces, not tabs. Tab width is 8. Indent is 4.
If an inconsistent naming is found, prefer project style, not file style.
Type and Namespace Naming
Use
CamelCasefor enums, classes and structs.Use
CamelCasenamespaces.Prefer full namespace paths where you refer to a type. It helps to read the code. For example
UI.Buttonis better than justButtonbecause a similarly named type might exist elsewhere.
Class Fields and Functions
Private fields
camelCase_(lowercase camel with underscore)All other fields
CamelCaseConst values
UPPER_CASEFunctions and get properties to start with
Get,Is, or another verb.Other functions to start with a verb, indicating the action they do.
Function Args and Variables
Prefer explicit types over
var, unless its obviousLongClassName c = new LongClassName()is silly, in such case just use var.Arguments and local variables are
camelCase