Skip to content

Conventions

Dorian Hawkmoon edited this page Feb 8, 2016 · 3 revisions

Definitions

  • camelCasing → nameOfVariable
  • PascalCasing → NameOfVariable
  • under_score → two_words

Spacing

  • Space between parameters of a method. Example: method(int one, int two)
  • No space between method name and its parenthesis
  • Space between values and operators ( x == y ) not ( x==y )
  • More rules and examples in wiki

Comments

  • Comments in the line above code, not the same line

Backets

  • Do not put brackets if is optional
  • Bracket start in the same line of sentence
  • Bracket end in a new line

Naming

  • Do not use Hungarian notation (append prefix with type of variable, example: strName)
  • Do use camelCase for member variables with initial underscore if is private (_aMemberVariable)
  • Do use camelCase for parameters and local variables
  • Do use PascalCasing for function, enums, event, and class names without underscore
  • Do prefix interfaces names with "I"
  • Do not prefix enums, classes, or delegates with any letter
Clone this wiki locally