3 ms·
Tooling developers don’t get to say “it shouldn’t matter”. It does matter, so the tools should account for this.
by pdpi 7y ago
Tooling developers don’t get to say “it shouldn’t matter”. It does matter, so the tools should account for this.
- twic 7y agoclang-format does account for this: if you break your includes into groups with blank lines, clang-format will sort within but not across the groups. That is, clang-format offers a crude but simple API to the programmer to express which headers have order dependency, and which don't. Given that headers can have order dependency, it is sadly part of a C++ programmer's responsibility to know which do, just as it is their responsibility to know which functions have side-effects, etc. If they are using clang-format, it is then their responsibility to communicate this knowledge to it.