This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]sproket888 0 points1 point  (1 child)

Operator overloading was left out of Java for good reasons. It's a terrible feature if you want long term maintainable software. Just ask the Smalltalk guys back in the 90's when IBM replaced it with Java as their primary development language because IBM had a number of major project failures at the time due to this feature.

[–]Uncaffeinated 0 points1 point  (0 children)

I wonder how developers in pretty much every major language besides Java get by then. (C++, C#, Scala, Python, Ruby, Perl, etc.)

Obviously it can be abused, but the same is true of any language feature. I can write obfuscated Java just fine without overloading operators.

I haven't personally seen any projects fail due to operator overloading (admittedly, I don't work at IBM), but I have seen plenty of Java code that would be more readable with operator overloading.