[1017] in java-interest
Re: overloading of operators
daemon@ATHENA.MIT.EDU (Robert O'Callahan)
Wed Aug 16 21:20:37 1995
Date: Wed, 16 Aug 1995 10:14:43 -0400
To: Tako Schotanus <Tako.Schotanus@bouw.tno.nl>, java-interest@java.sun.com
From: "Robert O'Callahan" <roc+@cs.cmu.edu>
At 10:46 AM 8/16/95 +0200, Tako Schotanus wrote:
>At 09:08 15-08-95 -0400, Robert O'Callahan wrote:
>>One more voice in the crowd - NO to overloaded operators. The demented ones
>>who want to program in C++ can program in C++. Speaking as a reformed one
>>myself.
>
>Could you please explain what op-overl. has to do with C++??
>I don't like C++ at all, it's much too complex for my taste, I still like
>op-overl. though (or think I do ;)
I think that C++ is the first popular language that supports general
operator overloading. Also, the maxim of "good programmers will use it
right" seems to be a key rallying cry in the community that still advocates
C++ (which, by the way, does not now include any C++ programmers I know!).
That attitude is responsible for, among other things, resistance to garbage
collection in favour of manual memory management, and rejection of real type
safety for the sake of being able to twiddle bits. I like Java because so
far it has rejected this attitude.
IMHO, a good language helps protect programmers from themselves. If you're
tempted to think "well then, you're just not as studly as I" - please
refrain :-)
By the way, one of the side effects of C++'s Pandora's box of features is
that there are no correct compilers, and there won't be for many years after
they eventually finish the standard. The operator overloading scheme has
contributed significantly to this debacle.
I think infix method invocation would be nice, but only if it can be cleanly
slotted into the grammar. This would probably mean a fixed precedence and
direction of associativity, but could provide a way to get rid of the the
String concatenation hack. I'd bite the bullet of writing "String.cat"
instead of "+" without hesitation.
Rob
======================================================================
Robert O'Callahan (roc+@cs.cmu.edu) 1st year CMU SCS PhD
Home page: http://www.cs.cmu.edu/~roc
"This bowl of lukewarm tapioca represents my brain. Bestow thy flickering
light forever." - Calvin & Hobbes, regarding television
-
Note to Sun employees: this is an EXTERNAL mailing list!
Info: send 'help' to java-interest-request@java.sun.com