2 ms·
This seems questionable. The author suggests 'faulting in' header files to trace dependencies, in pursuit of the iffy goal of including exactly what your compil
by JoeAltmaier 5y ago
This seems questionable. The author suggests 'faulting in' header files to trace dependencies, in pursuit of the iffy goal of including exactly what your compilation unit needs and no more.
So you're manually doing what the compiler and code pattern used to do for you. And creating dependencies in your source code to files that may become obsolete (include bar.h because foo.h needs it; then foo.h changes and now bar.h is no longer needed yet you still include it)
I have a different code pattern: header files include everything they need and no more; I include just the API's I use in my source files. I prefer this pattern by leaps and bounds over the OP's recommended technique. Because the source and tools manage themselves.