@bulb said in Which language is the least bad?:
Rust and Go have very similar models in this regard. The only difference is that Go only has dynamic polymorphism and Rust has both static and dynamic one.
And, well, it actually solves the issues with objects-as-value-types, because the bases—interfaces only—can't ever be by value, only the concrete types can and they are always final.
So then Rust has the same problem as Go, where there's no inheritance. Which makes it crippled to the point of near-uselessness for modern software development.
I have good memory.The whole reason C++ exists in the first place is zero-cost abstractions.
This is simply not true. That's its selling point today. But "zero-cost abstractions" is a code word for "templates", and those weren't even suggested until the language was several years old; they weren't (pseudo-)standardized until 1990, when it had already been around for more than a decade.
I am not talking about designing code with one or the other exclusively—I am talking about being able to distinguish the owner of the data, who can change them, and the consumers, who must not.
You're still making a very big assumption here. Why should that necessarily be the case. In many cases, it isn't. In others, it is.
C++ has const
for this, in Java and C# it requires verbose interfaces.
C++ also has const_cast
to work your way around it. Anders Hejlsberg once suggested that that's the only reason const
works in C++ at all, because you can cast your way out of it when you need to.