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


AddThis Social Bookmark Button
  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. Operator overloading in Java
    2003-05-17 19:41:31  anonymous2 [View]

  2. Operator overloading in Java
    2003-05-14 16:24:49  setok [View]

    • Operator overloading in Java
      2004-10-20 12:15:40  lokesh21 [View]

    • Operator overloading in Java
      2004-10-20 12:15:34  lokesh21 [View]

  3. Should have required StringBuffer
    2003-05-14 10:07:23  anonymous2 [View]

1 to 3 of 3