[937] in java-interest

home help back first fref pref prev next nref lref last post

Re: overloading of operators

daemon@ATHENA.MIT.EDU (Sean Elliott Russell)
Tue Aug 15 18:56:29 1995

To: java-interest@java.sun.com
Date: Tue, 15 Aug 1995 12:05:33 -0700
From: Sean Elliott Russell <ser@cs.uoregon.edu>

Everybody seems to be coming down on operator overloading, so I'll stick up 
for the new guy.

Operator overloading is a convention borrowed from centuries of 
mathematicians, and I see nothing wrong with it.  The symbols we use to 
represent common functions are simply that: symbols which represent an idea.  
As such, they should be allowed to operate on non-standard objects.  The 
classic case is a class implementation of complex numbers.  Why shouldn't I be 
able to add two complex numbers by using the '+' glyph?  It's clean, logical, 
standard in the world of mathematics... and illegal in Java.

Certainly, anything can be abused, and operator overloading lends itself to 
abuse quite readily.  However, programmers can be measured by their code, and 
good programmers should not be afraid of tools which test their skill.  One of 
the reasons why many of us prefere more complicated operating systems such as 
Unix to simple ones such as Mac System 7 is because System 7 is insulting.  It 
is an operating system which assumes you are stupid, or computer illiterate.  
I see fear of operator overloading in the same light.  We are not programming 
in Pascal.  Many of us do not require that the compiler assume we are 
incompetent programmers.

I, for one, would like the feature of operator overloading.  Its a powerful, 
elegant, and object-oriented feature which is sorely missed.

--- SER
Sean Russell               \ If trees screamed, would we be so cavalier
ser@cs.uoregon.edu          \ about cutting them down?  Maybe, if they
http://zebu.uoregon.edu/~ser ) screamed all the time, for no good reason.
Finger Me for PGP Key       / --- Jack Handy
NeXTMail Welcome!!!        /


-
Note to Sun employees: this is an EXTERNAL mailing list!
Info: send 'help' to java-interest-request@java.sun.com

home help back first fref pref prev next nref lref last post