Skip to content

Code Guidelines

Tim Lane edited this page Feb 4, 2019 · 10 revisions

Basic Guidelines

  1. Indentation brackets { and } should always be on a new line (for sake of consistency)
  2. Always add a copy constructor and assignment operator = overload to classes, UNLESS creating a simple utility class with no pointers (e.g. Timer). By default these should be encapsulated as private so that copies may not be made (with some exceptions, e.g. classes that instantiate to objects with low-memory usage)
  3. Wrap new classes and files with the ossium namespace.
  4. Cache the count when using for loops, e.g. for (int i = 0, counti = myarray.GetSize(); i < counti; i++)
  5. Please use PascalCase for classes, methods and functions. camelCase is fine for members and variables.

Clone this wiki locally