[1026] in java-interest
Re: overloading of operators
daemon@ATHENA.MIT.EDU (Tom Wheeler)
Thu Aug 17 02:15:13 1995
Date: Wed, 16 Aug 95 08:55:00 EDT
From: tomw@intelligraphics.com (Tom Wheeler)
Reply-To: tomw@intelligraphics.com (Tom Wheeler)
To: java-interest@java.Eng.Sun.COM
On Tue, 15 Aug 1995 10:45:23 -0700 you wrote:
>Howdy,
>
>> When you are adding number-like class (Matrices, Tensors, Quaterions),
>> nothing beats Op-Ov for readability.
>
>I agree that nothing beats
>
> Matrix a=..., b=..., c;
> c = a + b;
>
>for readability. However, I still feel that it would allow too many
>bad things...the price isn't worth it.
>
>> What we want to prevent is the
>> promiscuous abuse of Op-Ov for whatever might pop into the novice
>> programmer's so-called brain.
>
>True...only way to prevent is to refuse ;)
What you're saying is that because some people will abuse the feature
nobody should be allowed to have it. To draw a political analogy,
this is the same argument gun-control proponents use: because some
people misuse guns, nobody should be allowed to have them. Nevermind
how useful they (guns|overloading) might be, nevermind that the problem
is the person misusing the tool, just ban the tool. I for one don't
fall for that "logic", and I hope the other people here don't either.
If you want to discuss the difficulty of implementing operator overloading
in Java, or how much more complex it makes the language, or when overloading
makes sense, etc., fine. But let's not simply refuse it outright just
because some people will abuse it.
>> I notice no-one is complaining about the hard-wired Op-Ov in the
>> String class ...
>
>Absolutely, for two reasons:
>
>1 It's predefined in the language, not programmer dependent.
You mean the language is created and written by programmers? How odd....
Okay, sarcasm aside, why are the designers of Java to be held above
all other programmers? Sure, they've done some nice work... but there
are a lot of other coders out there who can write good code too. Why
not let them overload as well?
>2 It's a fairly well known and obvious construct.
And that's the important criterion here. In C++ the streams classes
overload << and >>. These aren't a part of the language itself (they are
a part of the library), but they are (now) a well-known construct in the
C++ community.
You seem to have a rather low opinion of programmers in general given
this strong desire to keep operator overloading out of Java. Granted,
there are a lot of people out there who can barely code their way out
of an infinite loop, but there are also a lot of programmers who can
write code most of the rest of us poor slobs can but dream of. Why
limit them just because of the potential for abuse by incompetents?
Regards,
Tom Wheeler
tomw@intelligraphics.com
-
Note to Sun employees: this is an EXTERNAL mailing list!
Info: send 'help' to java-interest-request@java.sun.com