Re: problems with Java
- From: blmblm@xxxxxxxxxxxxx <blmblm@xxxxxxxxxxxxx>
- Date: 31 Mar 2007 01:05:05 GMT
In article <cga0e4-pk9.ln1@xxxxxxxxxxxxxxx>, Mark Rafn <dagon@xxxxxxxxx> wrote:
ender <astrothayne@xxxxxxxxx> wrote:
[ snip ]
Simply having == call equals() and a DIFFERENT method for
object identity would save a ton of bugs.
Is this mistake really made often by programmers beyond the
beginner stage with Java? If it is, maybe you have a point,
but if it's made mostly be people new to Java, it seems to
me that there are some downsides:
It would further obscure the fact that all non-primitive variables
are references, not objects.
It also would introduce one more way in which references and
primitives are different. As it is now, "x == y" evaluates to
true if variables x and y are equal, and this is true no matter
whether x and y are primitives or references.
And it seems to me that unless you made a similar change to
the assignment operator (so that "x = y" copies the object
contents if x and y are references), again you'd have something
that feels inconsistent. (I haven't thought this part through
very carefully, though.)
[ snip ]
--
Decline To State
(But the e-mail address in the header is real.)
.
- References:
- problems with Java
- From: ender
- Re: problems with Java
- From: Mark Rafn
- problems with Java
- Prev by Date: Re: problems with Java
- Next by Date: Re: What sort of documentation is most useful for a java application?
- Previous by thread: Re: problems with Java
- Next by thread: What sort of documentation is most useful for a java application?
- Index(es):
Relevant Pages
|