I don’t know. This reminds me of the practice of putting everything into header files (“to inline everything, for performance”) which leads to longer compile times in practice because more things have to be recompiled.
I don’t get the issue with the traditional split of header and source files. There is a one time cost and then recompiles are faster.
The proposed method sounds like compilation or (worse) runtime issues for little gain.
I think the problem is that in C++ you end up having lots of code in header files, such as class members and templates. Then when you have dependencies between different source files and of course on the system headers, you end up including recursively lots of headers. That means a change in a single header file causes a cascading recompile which pretty much eliminates the benefits of incremental builds. Of course you have some crazy rules about includes (it’s in C though) to try to alleviate the problem.
I have to admit I don’t have firsthand experience in maintaining unity builds but seems like it’s worth it in larger projects.
I don’t know. This reminds me of the practice of putting everything into header files (“to inline everything, for performance”) which leads to longer compile times in practice because more things have to be recompiled.
I don’t get the issue with the traditional split of header and source files. There is a one time cost and then recompiles are faster.
The proposed method sounds like compilation or (worse) runtime issues for little gain.
I think the problem is that in C++ you end up having lots of code in header files, such as class members and templates. Then when you have dependencies between different source files and of course on the system headers, you end up including recursively lots of headers. That means a change in a single header file causes a cascading recompile which pretty much eliminates the benefits of incremental builds. Of course you have some crazy rules about includes (it’s in C though) to try to alleviate the problem.
I have to admit I don’t have firsthand experience in maintaining unity builds but seems like it’s worth it in larger projects.