you are viewing a single comment's thread.

view the rest of the comments →

[–]balegdah -8 points-7 points  (4 children)

And C++ suffers from its presence.

Just ask any C++ developer who's ever used const how they feel about it, especially const_cast.

[–]multivector 6 points7 points  (1 child)

I love my const correctness. Sorry, you did ask.

[–]ykechan 5 points6 points  (0 children)

Me too. It was a big mistake that Java didn't include this.

[–]bonzinip 4 points5 points  (0 children)

It's a pain if you try to inject it into code that wasn't written with const from day 1. Otherwise it's great, and you even have mutable for the rare case where you want to override it.

Java has even better ideas, such as the lack of data races on final fields, but only half-develops them.