The following is a set of guidelines to follow when contributing to TopDown.
The following is a set of guidelines to follow to maintain a consistent codebase.
If it seems for the best, feel free to propose a different guideline, or to fix code
that violates guidelines.
PascalCase
for type namesALL_CAPS
for constants_snake_case_with_underscore
for private class fieldssnake_case
for everything else
- Experimental: Use forward declarations only where needed (e.g. cyclic dependencies)
This is a tiny project, and the modules may fix the issue in the future, if it arises
- Don't use implicit boolean tests (e.g. compare to
nullptr
or0
explicitly)
- Experimental: Prefer get/set/get/set order for properties, instead of get/get/set/set
- Prefer instance methods to static methods - not developing a library here, a small amount of coupling is allowed
- Avoid returning references to fields, where a copy would suffice (breaks encapsulation)
- Experimental: Prefer left (west)
const
Despite the rules being simpler for east const, west const is more natural in many cases, and the cases, where the rules are hard - are rare