Skip to content

Coding conventions

Michael Schwartz edited this page Sep 20, 2018 · 3 revisions

Coding Conventions

See BTypes.h for the types we use.

Do not use int, use TInt instead. Do not use unix style uint8_t, use TUint8 instead. Etc.

  • Methods are CamelCase()
  • Classes are class CamelCase
  • global instances are camelCase

Names typically have a single character prefix:

  • TSomething indicates "Something" is a Type
  • BSomething indicates "Something" is a Base Class
  • GSomething indicates "Something" is a Game Class (app specific)
  • ESomething indicates "Something" is an enumeration or constant (ETrue, EFalse, ENull, etc.)

Class members will typically be prefeixed with lowercase m:

  • mPlayer (player instance)
  • mX, mY (coordinates)
  • etc.

Method arguments will typically be prefixed with lowercase a:

  • Foo(aArgument1, aArgument2, aFancyCamelCaceArgument)
Clone this wiki locally