Re: Weird Behaviour

From: Thomas G. Marshall (tgm2tothe10thpower_at_hotmail.replaceTextWithNumber.com)
Date: 10/14/03


Date: Tue, 14 Oct 2003 13:34:51 GMT

Walter Mitty <no@no.com> coughed up the following:

> Paul Lutus <nospam@nosite.zzz> brightened my day with his incisive wit
> when in news:vom0tbboriev1e@corp.supernews.com he conjectured that:

...[john jacob jingleheimer snip]...

> I asked a question Paul. As usual you have posted without answering
> it. Need I post the full source code? or are you so hung up on stupid
> semantics?
>
> Any programmer worth his salt would understand what passing object by
> reference means. Now, I task you, in plain english rephrase this in
> ONE sentence in order to dispute this commonly understood meaning.

Here's the problem IMO.

All rude posts aside, Colloquially, engineers will almost always say "pass
this object to this method". It is technically wrong, but whether or not
that is "ok to say" is another issue. I personally have no problem with it,
except that's not what you said.

You just now said "pass by reference", as did VisionSet early on, which
raises the warning flag because that phrase has a /very/ specific, very
/different/, meaning in CS, which is not a semantic argument in a forum
where there are newbies galore.

If you had to choose one post to read, read jon skeet's. Let's look at the
quickest example I can conjure at the moment:

Given this brain-dead method:

        void method(Object obj) { obj= null; }

Then in java:

        Object object = new Object();
        method(object);
        //object is untouched. method() did squat.

But if java were PBR:

        Object object = new Object();
        method(object);
        //object is now null.



Relevant Pages

  • Re: static class
    ... since at least Java 1.0.2, the initial release more than ten years ago. ... the situation was confused by adding a second meaning. ... Java 1.1 provides the option of declaring nested classes, ... To avoid confusion, they are often called ...
    (comp.lang.java.programmer)
  • Re: unicode
    ... You can't change the meaning of existing code, but if some language ... changed the definition in Java 1.8. ... the search for a superior moral justification for selfishness. ...
    (comp.lang.java.programmer)
  • Re: unicode
    ... You can't change the meaning of existing code, ... changed the definition in Java 1.8. ... Roedy Green Canadian Mind Products ... the search for a superior moral justification for selfishness. ...
    (comp.lang.java.programmer)
  • Re: (Probably) easy question about inheritance
    ... Vector has specific meaning already in Java, ... If Vec extends Matrix then Vec has MORE fields and methods than ... The Java Glossaryhttp://mindprod.com ... Vectors for math purposes because that's what they're called, ...
    (comp.lang.java.programmer)