Neat Neat Neat

Code Styling

Code Style Requirements

The requirements when stylizing code such as the C# used by unity are driven by Use Cases.

  • Collaborating – Use a style and be consistent with your collaborators.
  • Skim reading – Use a style that is quick to skim read.
  • Detailed examination – Use a style that is pleasant when studying detail.
  • Source control verification – Use a style that allows clear comparison during revision checking.

Example C# Style

  • Classes are Capital Case.
  • Member variables are _ camel Case.
  • Member functions are Capital Case.
  • Local variables are camel Case.
  • Passed parameters are camel Case. 

Alternate Style

  • Classes are Capital Case beginning with “C”
  • Member variables are Capital Case.
  • Member functions are Capital Case.
  • Local variables are lower_case with “_”.
  • Passed parameters are lower_case with “_”.

Leave a Reply