Skip to content

Programming Conventions

Nicholas Baron edited this page Aug 6, 2018 · 5 revisions

Preprocessor Conventions

For greater compiler compatibility, use #ifndef instead of #pragma

  1. #include ""
  2. #include <> //OpenGL above C++
  3. #define //CODE BLOCKS
  4. #define //PURE VALUES

Keyword Limits

  • Do not use "using"
  • Avoid cluttering the default and std namespaces
  • Do not use "typedef"

Memory Allocation

  • Primitives: Always on the stack
  • Arrays & Structs: If the elements have a changeable size, the heap.
  • Objects: Always on the heap
Clone this wiki locally