4 ms·
His opinions on include files have fallen out of favor because compiling is faster and it adds needless work. Are there organizations that still do this? All th
by z_open 2y ago
His opinions on include files have fallen out of favor because compiling is faster and it adds needless work. Are there organizations that still do this? All the style guides I've seen do not.
- dapperdrake 2y agoIf your filesystem and disks are fast enough, then maybe Rob's assumptions don't apply.
- ryandrake 2y agoI still adhere to this for personal hobby projects, more out of a sense of craftsmanship than anything practical at this point.
- csb6 2y agoI believe clang and gcc avoid reading in and re-processing include files that are already included, so his advice is unnecessary and creates a lot of maintenance burden, especially for C++ where a lot more code is in header files. It may still be useful for old compilers, though.
- kevin_thibedeau 2y agoThey recognize include guards and skip any further inclusions for those cases. There are scenarios where you may want multiple inclusion and you can still have that.