C++20 Cleaner Code Tips
06 Feb 2023
[
c++20
development
coding
]
Tips
- Use the Core Cpp Guidelines and tools that help you implement them.
- Use SOLID principles to guide design.
- Orgzanize headers to reduce coupling.
- Use modules for new projects.
- Consider using std::expected for expected errors.
- Use generators for lazy evaluation and for inversion of dependencies.
- Avoid Primitive Obsession.
- Use interfaces on component boundaries.
- Inject implementation dependencies.
- Consider the use of Inversion of Control containers to construct objects.
- Prefer composition over implementation inheritance.
References