News for hackers. Stuff that matters.
Re:Clang Format Tanks Performance by lilyball on Wednesday November 20, 2019 @03:44AM (#21582182)
Headers really shouldn’t be affecting each other. Header order shouldn’t matter. The fact that it does is arguably a bad design flaw in C/C++, although the C modules system pushed by Apple fixed this.
Re:Clang Format Tanks Performance by pdpi on Wednesday November 20, 2019 @05:18AM (#21582586)
Tooling developers don’t get to say “it shouldn’t matter”. It does matter, so the tools should account for this.
Re:Clang Format Tanks Performance by twic on Wednesday November 20, 2019 @09:41AM (#21584267)
clang-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.

Re:Clang Format Tanks Performance by dleslie on Wednesday November 20, 2019 @03:08PM (#21587931)
The simplest way to communicate that this anti-feature is unwanted is to add this to your clang-format:

   SortIncludes: false
Re:Clang Format Tanks Performance by pdpi on Wednesday November 20, 2019 @10:47AM (#21584892)
Ok, that is a fairly unobtrusive way to describe dependencies, fair.