Re: problems with Java
- From: dagon@xxxxxxxxx (Mark Rafn)
- Date: Fri, 30 Mar 2007 14:02:36 -0700
ender <astrothayne@xxxxxxxxx> wrote:
I do not understand why Sun believes that by denying the
programmer powerful tools they are keeping us "safe".
Then you've never had to support someone else's code, I suspect. There is not
a direct correspondence between power and abusability, and I fully support
leaving out features that are
1) abused more often than not
2) not a hardship to do without
In almost all cases, features left out of Java have more easily-understood
idioms to get the job done.
First is the lack of operator overloading. I have
seen many arguments for why operator overloading was not included
however to me operator overloading seems an important part of OOP.
I agree with you here. A _LIMITED_ form of operator overloading would make
the language clearer. Something like hardcoded operators, such that
Object has an implementation of
Object operator(Operator, Object)
And operators are just shorthand for calling this method. Override at will.
Simply having == call equals() and a DIFFERENT method for
object identity would save a ton of bugs.
The second thing is that you should have more control over how objects
are passed. Although pass by reference is preferable in most cases
there are many instances when pass by value is required, having to
constantly use clone() is not a very efficient, or safe way.
Here I disagree. Making the Clone() explicit is a fine workaround, and makes
the programmer know what's happening.
It would be beneficial to have some form of data type. If a data type is
added however it should not follow the mistake of c# and restrict
inheritance as there are many times when data types should inherit.
I'm unclear what this means. How is a data type different from a final
immutable object?
The third and most important issue deals with consistency. There is a
huge gap between primitive types and user defined types where there
doesn't need to be.
I don't think anyone disagrees here.
Some other features I would like, but are not quite as sever are
Multiple Inheritance
I'm torn on this. There's a LOT of complexity for not very much power, but
it's a power there's no good workaround for.
better support for properties
Fully agree.
and some form of function pointer.
Disagree. Better syntax for anonymous inner classes, sure. Pure function
pointers aren't needed.
--
Mark Rafn dagon@xxxxxxxxx <http://www.dagon.net/>
.
- Follow-Ups:
- Re: problems with Java
- From: blmblm
- Re: problems with Java
- From: Matt Humphrey
- Re: problems with Java
- References:
- problems with Java
- From: ender
- problems with Java
- Prev by Date: What sort of documentation is most useful for a java application?
- Next by Date: Re: Month difference between dates
- Previous by thread: problems with Java
- Next by thread: Re: problems with Java
- Index(es):
Relevant Pages
|