Skip to content
This repository has been archived by the owner on Sep 18, 2020. It is now read-only.

Cpp coding convention

Michał Gallus edited this page Feb 24, 2017 · 5 revisions

Descriptive names. If necessary, prefer long names over shortcuts.

  • Class names: PascalCase
  • Methods/Function names: PascalCase
  • Local variables: camelCase
  • Class fields: m_Name
  • Static names: s_Name
  • Global variables: g_Name
  • Namespaces: PascalCase
  • Constants: UPPERCASE_WITH_UNDERSCORES
  • Macros: SAME_AS_ABOVE
  • Enum names: PascalCase
  • Constants in enums: UPPERCASE_WITH_UNDERSCORES

Braces:

if (true)
{
// not java-like
}

Also, prefixing pointers with p, i. e. m_pWindow, or pObject.

When in doubt, please refer to http://www.insomniacgames.com/core-coding-standard/

Clone this wiki locally