CppGeek
Practical, Pragmatic, C++
-
Header Files
Posted on March 21st, 2009 1 commentThe physical design of a project is a vast topic, I think it will be useful to suggest some simple practices that will help point you in the right direction when you are just starting a project. They can also be applied to a large project but more care is needed.
The first things you can do:
- Make all headers standalone
- Keep your classes in seperateĀ .hpp and .cpp pairs, aim for one class per file.
- Use precompiled headers as an optimisation technique and nothing more.
- Don’tĀ put using namespace in any of your header files, you’ll pollute the namespace.
- Be careful of templates and where they are defined.


