3 ms·
Modula had "import" in 1975, and C is only barely younger than it; the first version of C appeared in 1972, and the first version with structures appeared in 19
by trealira 3y ago
Modula had "import" in 1975, and C is only barely younger than it; the first version of C appeared in 1972, and the first version with structures appeared in 1973.
It's surprising to me that the creators of C++ didn't add modules in the 1980s, given it was literally called "C with classes" at first and was trying to be a better C. Modules seem like a lower-effort way to improve C than the addition of classes.
- nine_k 3y agoConditional includes play a big role as a configuration mechanism in C. Likely the creators of C++ could not afford to get rid of that.
- trealira 3y agoYou don't have to get rid of #include and the preprocessor to add modules. The ISO C++ committee has added modules to the newer standard and they haven't gotten rid of headers and conditional inclusion. Modules would be nice just so that the build system doesn't have to rely on things like "gcc -MMD" generating header dependencies of object files for inclusion in Makefiles.