3 ms·
The problem with C++ isn't so much that it's compatible with C or that you shouldn't pay for any features that you shouldn't use -- it's that they used the same
by wvenable 16y ago
The problem with C++ isn't so much that it's compatible with C or that you shouldn't pay for any features that you shouldn't use -- it's that they used the same dumb linker as C and so most advanced features are grossly limited and ended up as a twisty maze of text manipulation and includes.
- apenwarr 16y agoThat's no longer true; the linker has been massively extended to support templates at this point. (Otherwise every file that instantiated a particular template would result in all the code for that template being duplicated in the final executable. This actually used to happen in older C++ compilers.)
- wvenable 16y agoI don't consider that massively extended -- that's a optimization but it's not really a fundamental change in the way the linker works.
- acqq 16y agoAbsolutely! Damn language innovators who think that solving module linkage is "not sexy" but modifying syntax to be unprocessable by people and machines is. Google Go is fast because it stole ideas from Wirth and followers (Turbo Pascal, Modula) who actually took the care to provide sane module linkage for decades. The proper path to the evolution of C was to keep includes and classic linking but to allow "module linking" too. All that was being done for decades, only not in C and C++.