3 ms·
My personal favorite metaphor for the complexity of C++ (and other languages, like Scala) is a hamster wheel. You enjoy writing it, but from the outside it feel
by munchbunny 8y ago
My personal favorite metaphor for the complexity of C++ (and other languages, like Scala) is a hamster wheel. You enjoy writing it, but from the outside it feels a bit ridiculous to see the amount of energy dedicated to problems of your own making.
R-value references, for example. This is entirely a problem that C++ has created for itself with its copy semantics. From inside the C++ ecosystem, the language feature makes sense, but from outside the C++ ecosystem, the idea that there are now two types of references and two types of copy semantics triggered based on the implicit interaction of reference types, and you sometimes need to do idiomatic things like declaring undefined private copy constructors to lock down unintended implicit behaviors relating to copy semantics for R-value references... yup, hamster wheel.
C++ isn't the only language where I get this feeling. I think Scala is pretty guilty of this too. It's not that I can't grok it if I wanted to (survived my share of proof based, pure theory math classes back in college), it's that I think it's entirely too much energy to be spending on mundane code.
- jstimpfle 8y ago> two types of references include normal pointers and it's three.
- ryanianian 8y agoadd const-ness and you get *2. Then ponder what `const &&` even means.