Description
GitHub user @p1v0t suggests using <cXXX>
instead of <XXX.h>
in our source code. Seems like a good idea, though they didn't include likely required fixes for uses of things now in the std::
namespace.
In general, it's a good idea, but we need to ensure that the existing codebase is either std::
clean or is made to be std::
clean.
In addition, includes should be have the associated header as the first include before anything else. For example, in foo.cpp
, the header foo.h
should be included before anything else. This ensures that any dependencies for the header itself have been declared without requiring additional includes first.
Then a blank line, then after that, local headers, in alphabetical order.
After that, separated by another blank line, all system and standard headers, in alpha order.
Thoughts?
If we agree to this, then it should be done for all three books:
- In One Weekend
- The Next Week
- The Rest Of Your Life