2,599
edits
Efernandez (talk | contribs) |
Efernandez (talk | contribs) |
||
Line 12: | Line 12: | ||
In general, if you are adding code to an existent code, be consistent with the coding standard already being used. If no standard is used then follow this guide. | In general, if you are adding code to an existent code, be consistent with the coding standard already being used. If no standard is used then follow this guide. | ||
=== Self contained headers === | |||
Header files should be self-contained (compile on their own) and end in .h. Non-header files that are meant for inclusion should end in .inc and be used sparingly. | |||
All header files should be self-contained. Users and refactoring tools should not have to adhere to special conditions to include the header. Specifically, a header should have header guards and include all other headers it needs. | |||
Read more [https://google.github.io/styleguide/cppguide.html#Self_contained_Headers here] | |||
=== The #define Guard === | |||
All header files should have '''#define''' guards to prevent multiple inclusion. The format of the symbol name should be <PROJECT>_<PATH>_<FILE>_H_. | |||
=== Comments === | === Comments === |