12 ms·
C++ is somewhat notorious its developers' practice of selecting different subsets of C++ as "the good bits". I think one of the biggest mistakes of C++ was con
by klodolph 12y ago
C++ is somewhat notorious its developers' practice of selecting different subsets of C++ as "the good bits". I think one of the biggest mistakes of C++ was conflating the three different concerns of record types, polymorphism, and encapsulation. All three are bundled up in the catch-all "class", and everyone comes up with their own workarounds which should have been language constructs to begin with. So you'll end up with a language which enforces your C++ style.
The good bits everyone agrees on are parts like <algorithm>, and oh man, I have a hard time imagining how you'd make that easy to follow.
- deleted 12y ago[deleted]
- possibilistic 12y agoI hear the "different C++ subsets" meme all the time. To the best of my knowledge, this is typically cited in relation to template generics, exceptions, multiple inheritance, and RAII being used incongruently. IIRC, Google chose not to use exceptions, but this might be unrelated. (ex-googlers I know have mentioned that Google doesn't care about C++ services terminating and having to be respawned) Your comment kind of makes me question my understanding of the different subsets issue... Would you mind elaborating? I could really stand to understand this better. If you can't expand on it, thanks for giving me something to look into. :)
- klodolph 12y agoIn particular: * Inheritance-heavy subsets, which avoid templates in favor of dynamic dispatching. * Template-heavy subsets, which avoid dynamic dispatching in favor of templates. * Subsets avoiding exceptions. * Subsets avoiding RTTI (dynamic_cast and friends). * Subsets avoiding pointers (including smart pointers). * Subsets avoiding the use of container libraries. * Subsets avoiding the use of <string>. * Subsets avoiding the use of <iostream>. You can search for large projects' style guides. For example, Clang uses C++11 features BUT they avoid RTTI and exceptions, which is a relatively common choice.