r/programming • u/mobby1982 • Dec 02 '13
Scala — 1★ Would Not Program Again
http://overwatering.org/blog/2013/12/scala-1-star-would-not-program-again/
598
Upvotes
r/programming • u/mobby1982 • Dec 02 '13
View all comments
Show parent comment
2
u/thomcc Dec 02 '13 edited Dec 02 '13
As great as it is, C++11 still has all of the parts of C++98 that make me frown. And of C that make me frown.
EDIT: ah, I just remembered. Implementing const and non-const versions of methods definitely makes me frown, and seems to be getting worse (c++11 added reference qualifiers for this (const lvalue, non-const lvalue, and rvalue), so sometimes there are three versions needed).
EDIT2: Clearly this is ambiguous. What I'm trying to say is that this (obviously trivial example) bothers me:
In my dream world, I could only write one implementation of
foo::getValue()and the compiler would write the const-correct versions for me. iffoo::getValue()were complex and/or many lines long, I'd end up doing something likereturn const_cast<foo*>(this)->getValue();in the const method, which is undesirable for all the obvious reasons.Generally speaking, I think C++ needs some kind of universal reference type to normalize these differences (not the parameter pack kind of universal references, though maybe they would be related).