7 ms·
That's fine and dandy as long as you don't use C++ with templates and other stuff that needs 90% of the code to be in the headers. Any recompile triggers a lot
by carlmr 3y ago
That's fine and dandy as long as you don't use C++ with templates and other stuff that needs 90% of the code to be in the headers.
Any recompile triggers a lot of recompilation.
And no, I can't change the code the other hundred devs are writing in my company.
In C++ there is no individual units. In C it's somewhat plausible with some discipline.
- penguin_booze 3y ago> In C++ there is no individual units There's a still a notion of the compilation unit, which is the cpp file on which you invoke the compiler. Due to templates being prevalent in C++, included files contain the implementation as well; so any changes you make there lead to re-compiling a lot more compilation units than, for example, in C.
- carlmr 3y agoThat is kind of restating my point. There might be these translation units, but they're tightly coupled to all the other translation units, making them not very individual IMO.
- JohnFen 3y agoyes, that's why I used the disclaimer "as long as I can compile individual units and link them". The problem with C++ templates is accurate, and is one of the several reasons why I avoid using templates in my own C++ code. I don't have that freedom in the code I write for my employer, though. > In C++ there is no individual units. Yes, there are. Those unit boundaries are often blurred by other C++ features, but they do exist.