3 ms·
On the contrary, this is the best way to make code reusable, because it is the only way that allows a C or C++ program to add more code solely via the compiler,
by jblow 11y ago
On the contrary, this is the best way to make code reusable, because it is the only way that allows a C or C++ program to add more code solely via the compiler, without also requiring modification of external build scripts / tools / etc.
When you are shipping and maintaining code on 5 or 10 different platforms, this really matters, because the friction of adding new files becomes huge ... you have to go add that file to 5 or 10 different fuckity fuck build systems that are all uniquely terrible, and hey maybe Apple updated XCode to whatever the new lousy version is instead of the old lousy version, so you have to go through the rigamarole of installing that, which of course won't completely work, oh and the internet is slow today, and on some console platform that shall not be named our dev software didn't auto-renew its license and that is mysteriously timing out so now we get to deal with that for hours, blah blah blah.
This is not an exaggeration. You're lucky if you actually get to do any programming on the day you decide to add a cpp file.
Experienced programmers who ship on a lot of platforms really want the simplest and most straightforward way of using code, and this is what that is for C and C++.
More modern languages could be designed to be better at this, but they usually aren't. (A 'package manager' is not really the answer, it is a solution to a kind-of orthogonal problem and usually brings in way too many of its own complexities.)