[593] in java-interest
Re: Operator overloading
daemon@ATHENA.MIT.EDU (John Mitchell)
Wed Jul 5 15:59:37 1995
From: johnm@medicus.com (John Mitchell)
Date: Wed, 5 Jul 95 11:40:07 PDT
To: java-interest@java.Eng.Sun.COM
[Could you limit your line width to < 80 characters. It's much easier
to read that way. Thanks.]
[...]
> - A future user of the class can then use directly obj1+obj2 and
> he has not to read the doc of each classes he imports for knowing how to
> add them.
Ugh. Phui! Nearly everyone has different ideas about what the (overloaded)
operators *mean*. What are the semantics of using the overloaded *
operator when given a Matix class and a) an integer, b) a string,
c) a differently dimensioned Matrix, or finally d) a like dimensioned
Matrix.
Questions your assumptions has always seemed like a good rule of thumb...
[...]
> Whatever the language can be, everyone can write howfull codes.
awful???
> EVEN in Java.
> Good programers can write Object Oriented pure and clear
> assembler codes. The langage is just a tool for programers : not a
> low to respect.
law
Ah but the question is not so much the philosophical debate of what's
right *in theory* in the power/expressivity versus constraint. The question
is what's right given the *people* involved. There is no one solution.
All languages are examples of people making various tradeoffs between the
two extremes.
BTW, I have written OO code in an OO version of 80x86 assembly language.
It's not something to give to dullards or even pretty sharp programmars
because there's a lot of crap that can and will go wrong. Sure, the code
is super tight, super small, etc. For the incredibly vast majority of
people it's patently silly.
[...]
> Since a long time, new langages gave us more than older languages.
> Java give us
> - the Interface concept : good thing in place of virtual
> functions of C++.
What do Java Interfaces have to do with C++ virtual functions? Perhaps
you are thinking of writing abstract virtual base classes in C++ to
sorta mimic the Interface concept?
> It's provides the concept of virtuality by explicit encapsulation of what is
> virtual and implemented : realy prety thing .
It's the separation of interface inheritance from implementation
inheritance. In doing so Java allows for multiple interface inheritance
but only single implementation inheritance.
[...]
> Java RESTRICT us on:
> - C++ TEMPLATE powerfull concept is not in Java. Why NOT ?.
> It's so comfortable to write ONE code whatever datas could be. I am not
> sure that the use of Java 'interface' for parameters permit us the same
> abstraction as C++ 'templates'.
[...]
C++ templates are retarded. [Gee, I'm not opinionated or anything... :-)]
I do like fully parameterized types but definitely *not* the basically
textual substitution method of C++.
Take care,
John
P.S. Just my personal opinions.
-
Note to Sun employees: this is an EXTERNAL mailing list!
Info: send 'help' to java-interest-request@java.sun.com