ONJava.com -- The Independent Source for Enterprise Java
oreilly.comSafari Books Online.Conferences.

advertisement

AddThis Social Bookmark Button
Article:
  What I Hate About Your Programming Language
Subject:   Operator overloading in Java
Date:   2003-05-14 03:16:09
From:   anonymous2
You wrote:
The inconsistencies between what the language allows and what the standard library actually does bother me. If operator overloading is so bad, why does the String class do it?


------------------------------------------


The philosophy behind that may be that overloading is not necessarily intrinsically "bad", but has the potential to generate unintuitive code.
The one supported instance of String concatenation is a natural and intuitive use of overloading.
Also, to eliminate it just in principle for consistency would deprive Java programmers of an extremely useful timesaver.



1 to 3 of 3
1 to 3 of 3