[1072] in java-interest

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

Re: Operator Overloading

daemon@ATHENA.MIT.EDU (Andrew Wason)
Fri Aug 18 00:22:59 1995

To: java-interest@java.Eng.Sun.COM
In-Reply-To: Message from Thomas.Ball@eng.sun.com (Thomas Ball) 
   of "Tue, 15 Aug 95 09:25:30 -0700."   <9508151625.AA27876@alapa.Eng.Sun.COM> 
Date: Thu, 17 Aug 95 12:31:22 -0400
From: Andrew Wason <aw@bae.bellcore.com>

Thomas.Ball@eng.sun.com (Thomas Ball)  writes:
> You'll 
> find it much more difficult to come up with a compelling example using
> any of Java's AWT or Net classes.

Here's an example from a commercial class library (I think it's
more revolting than compelling).

This is a snippet of code from some product literature for the
Zinc Application Framework:

    // Add the movie control window
    *windowManager + new MOVIE_CONTROL;

Apparently this adds a new widget to the applications main
window.  The comment next to this says "Use the overloaded +
operator to write clear, intuitive code".  Zinc has other
interesting uses of overloaded operators.

This is what happens when you provide a language feature like
operator overloading, many people can't stop themselves from
using it everywhere possible.  Operator overloading is like an
addictive drug to them.


Andrew

_______________________________________________________________________________

Andrew Wason                                       Bell Communications Research
aw@bae.bellcore.com                                Piscataway, NJ
-
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