News for hackers. Stuff that matters.
Re:Extreme include discipline for C++ code by woodrowbarlow on Friday May 13, 2022 @10:04AM (#31367763)
so this discipline speeds up compilation, but makes the code "annoying" to write and requires "eternal vigilance".

fast compiles are nice but to trade away your code's hackability seems infinitely counter-productive to me. won't that have an immense negative impact on total development time?

Re:Extreme include discipline for C++ code by kevindong on Friday May 13, 2022 @10:16AM (#31367943)
I think the author is asserting that trading away the hackability is worth the faster compile times because faster compiles lets you iterate faster and therefore increases hackability (i.e. put in minutes of effort once and get minutes of benefits per compile in the future).
Re:Extreme include discipline for C++ code by yolo69420 on Friday May 13, 2022 @10:21AM (#31368006)
if you work on a non-trivial c++ code base, being vigilant about compile times can literally make the difference between compiling your codebase from scratch in a minute vs. compiling it in an hour or more. 0% exaggeration here. With similar relative differences for incremental compiles. Nothing kills a code-base's hackability like waiting around to be able to actually run code you wrote.

Include code style is also just the tip of the iceberg. This also includes not using many c++ features that blow compile times up unless the gain from using them is so big that you eat the compile time (like containers would be an obvious example).

Re:Extreme include discipline for C++ code by ncmncm on Friday May 13, 2022 @02:47PM (#31371187)
The good news is that abandoning this "eternal vigilance" has no effect on compilation time, but speeds up development by the exact degree that you don't waste that time and attention anymore.