Tuesday May 03, 2005
Java and operator overloading.
It bemuses me that Java guru Joshua Bloch is still anti operator overloading ("Java Puzzlers" webcast from Javapolis, with Neal Gafter).
if (a > b) is apparently more confusing than
if (a.compareTo(b) > 0)?
I totally get that arbitrary overloading isn't very javalike, but allowing specific operators (.compareTo overloads comparison ops, .addTo overloads + etc.) for classes tagged with particular interfaces doesn't seem that much of a mess. Hey ho.