Skip to content

Coding Guidelines

ラ⭐ edited this page Jul 4, 2023 · 2 revisions

Formatting

  • All type names are snake_case.
  • All methods are snake_case.
  • All variable names are snake_case.
  • All file names are snake_case with the exception of tests which are written as foo-test.
  • All implementation files should use the .cc extension
  • All header files should use the .h extension.
  • All inline files should use the .inl extension.
  • Structs should not contain access labels and all members should be public (If you need to distinguish between public, protected and private then it should be written as a class instead)
  • Member variables of classes should be prefixed with m_ (ex: m_count).
  • Struct members can be written with a _ postfix (ex count_) to avoid conflicts and to denote it should not be accessed directly.
  • Brackets should appear on the next line with the exception of lambdas where the first bracket may appear on the same line as the definition.
Clone this wiki locally