BlueBrain / hpc-coding-conventions

Apache License 2.0
8 stars 5 forks source link

<> vs "" #98

Closed castigli closed 3 years ago

castigli commented 3 years ago

According to Google's guidelines headers that are part of the project with a folder structure `project/src/feature/necessary.h' should be included as

#include "feature/necessary.h"

https://google.github.io/styleguide/cppguide.html#Names_and_Order_of_Includes The idea is to highlight with "..." the fact that the header is part of the project

However, when the header is included from project/src/another_feature/file.cpp when using "..." the pre-processor first would check the current folder then the included path, so in a way it is more natural to use <...> and it should be (negligibly?) faster. https://en.cppreference.com/w/cpp/preprocessor/include

Thoughts?

tristan0x commented 3 years ago

The build time benefit of using "<...>" is negligeable compared to the added value of clearly separating internal includes from externals ones.

castigli commented 3 years ago

fair enough, I didn't see much difference on ~100's of files.