I’m having to decide on some coding standards that are to my liking. If you have any suggested amendments I’d love to hear them.
- Don’t use “#pragma once”, this is Windows specific
- Use #ifndef and macro definitions as they are suitable for all environments.
- Don’t use “using namespace” within header (.h) files, only code files (.cpp)
- Global variables should be prefixed with “g_” and prefixed with a lowercase letter
Classes and Namespaces
- Classes should be stored in suitable namespaces
- Class and Function names should start with the first letter capitalised
- Private class member variables – start with “m_” and the first letter is lowercase
- Public class variables should begin with the first letter capitalised
- Function parameters should start with a lowercase charachter
- Declare as null
- Remember to deleted
- Set to null again once deleted