Re: problems with Java



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.)
.



Relevant Pages

  • Re: Why C# and Java have got it wrong
    ... Do you have any references to the claim that there is a fixation ... on garbage collection? ... that there have been "don't need to manage my resources" evangelizing ... >Java and C# actually provide poor tools for resource management. ...
    (comp.programming)
  • Re: Game programming -- Java performance?
    ... references to one another as a) indices, names, or other things and b) ... Murphy's Laws of java programming: ... Haha, well, you should probably try to find out why (perhaps step through with a debugger, or look at the source code?) ... If the app seems to have hung and you're sure it's an infinite loop ...
    (comp.lang.java.programmer)
  • Re: A list of cities going farther and farther back into antiquity
    ... that I deal with literary evidence. ... you can do to stop my posting. ... references that don't show any real understanding of the issues ...
    (sci.archaeology)
  • RE: JAVA un z/OS
    ... Additionally in the case of primitive integers, Java has to ... from Little Endian to Big Endian before sending the CPU instruction, ... than back after the instruction is done. ...
    (bit.listserv.ibm-main)
  • Re: Return local object from function
    ... I thought that Java references were 64 bits (8 ... a pointer and there's therefore more going on in there than a simple ... contiguous in memory within another object. ...
    (comp.lang.java.programmer)