Am I the only one who feels like header files in C/C++ are duplication?
We declare things in headers, define them in source, keep them in sync manually, sprinkle include guards everywhere... all to prevent problems caused by the very system we are forced to use. It's like writing code to defend against the language's file model rather than solving actual problems.
And include guards especially - why is "dont include the same header twice" something every project has to re-implement manually? Why isn't that just the compiler's default behavior? Who is intentionally including the same header multiple times and thinking "yes, this is good design"?
It feels like a historical artifact that never got replaced. Other languages let the compiler understand structure directly, but here we maintain parallel representations of the same interface.
Why can't modern C++ just:
treat headers as implicitly guarded, and maybe
auto-generate interface declarations from source files?
https://redd.it/1rgyeqp
@r_cpp
Post #24809
23