3 ms·
That was the argument of C++ advocates in the 90s.
by NeedMoreTea 8y ago
That was the argument of C++ advocates in the 90s.
- kibwen 8y agoConsidering that C doesn't have any good facilities for polymorphism, it's going to continue to be the argument of any language that succeeds C. Unless, that is, that successor language also doesn't have any good facilities for polymorphism, in which case we have Go as a fascinating real-world study in how people will incessantly demand them and deride the language for lacking them (which is saying something, considering that interface{} in Go is already better than pretty much anything one would hack up in C via void pointers or macros).
- pjmlp 8y agoAt least C11 has light generics support.
- CyberDildonics 8y agoWasn't it originally a much bigger deal to be able to have the facilities for more generic programming before templates? These days people's threshold for bloat seems much higher, while the penalty for allocation and jumping around in memory are much higher as well.
- basementcat 8y agoApparently under certain conditions it is possible to emulate a crude form of ad hoc polymorphism in C. https://codegolf.stackexchange.com/questions/2203/tips-for-golfing-in-c/114619#114619 https://codegolf.stackexchange.com/questions/2203/tips-for-g...
- AnimalMuppet 8y agoI presume that you are defining C++'s virtual functions as "not a good facility for polymorphism". Why?
- int_19h 8y agoOP said nothing about C++, just plain C.
- AnimalMuppet 8y agoAh, I see. I agree.
- marcosdumay 8y agoIt was just recently that C++ got some underpowered kind of generics (beyond templates). So, no, I don't think anybody advocated that in the 90's. Late 90's advocacy was much more on the lines of "OOP lets you reuse code" and "widget libraries are great, and they all but require OOP". One of those is blatantly correct.