stop calling c++ headers .h
Here's the short of it: if a header is meant only for C++, name it something.hpp. Leave .h for the rare files that really do compile under C as well.
Why I bother:
- my editor and linter flip into the right mode when they see
.hpp, so i don't get bogus warnings. - a quick
grep --include='*.hpp'skips every c header in the repo. big time-saver. - new devs don't have to ask whether
utils.his safe to include from c.
Nothing magical here — the pre-processor will gladly pull in sandwich.bun if you ask. This is just about not tripping up people and tools. Two extra letters, endless micro-wins.
Got mixed feelings? Keep the legacy .h files as-is. For anything new that's C++-only, stick with .hpp and call it a day.
That's it. Happy coding.