Re: What computer language is used a lot in the IT industry?
From: Gerry Quinn (gerryq_at_DELETETHISindigo.ie)
Date: 07/01/04
- Next message: Mudge: "Re: OOP and memory management"
- Previous message: korsarz: "Re: which algorithm fits..."
- Maybe in reply to: Programmer Dude: "Re: What computer language is used a lot in the IT industry?"
- Next in thread: Corey Murtagh: "Re: What computer language is used a lot in the IT industry?"
- Reply: Corey Murtagh: "Re: What computer language is used a lot in the IT industry?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Thu, 1 Jul 2004 09:47:12 +0100
In article <dxLEc.25055$Xn.20344@nwrdny03.gnilink.net>,
tgm2tothe10thpower@replacetextwithnumber.hotmail.com says...
> Gerry Quinn <gerryq@DELETETHISindigo.ie> coughed up the following:
> > In article <o9CEc.23061$Xn.9403@nwrdny03.gnilink.net>,
> > tgm2tothe10thpower@replacetextwithnumber.hotmail.com says...
> > In Java, what is passed is a reference to something to which exactly
> > that can be done.
>
> That doesn't have anything to do with the reference itself!
I know - the irrelevance of the reference itself is exactly what I've
been pointing out!
> > Passing this reference is the only function of the
> > passed parameter, which is why the passed parameter is called a
> > 'reference'. The compiler writer may be interested in the value of
> > the reference per se, but nobody else is.
> >
> > What do we pass? A reference. So how are we passing? By reference,
> > obviously!
>
> Nope.
>
> Ok, let's break this down.
>
> "Passing A" idicates that /something/ is going to be passed
>
> "Passing BY" indicates the /way/ that something is going to be passed.
>
> What do you pass? A reference.
>
> How was it passed? BY VALUE.
I understand the argument perfectly well. But the point is essentially
a useless one - the reference or pointer or whatever is just a tool I am
using to do a job which is to pass something about what the reference
refers to. To say 'Java passes by value' is to impoverish our ability
to speak of what we want to do in a Java program. At least be specific
when you say "Java passes by value" and point out that you are referring
to how "Java passes references by value", or "passing the value of the
position of a sentence describing how Java passes references by value",
as you would no doubt prefer to say!
> > Therefore, since all languages pass something by value (at least from
> > the point of view of the language), the only distinction of interest
> > is whether they can pass by reference as well. The natural
> > distinction is whether they pass a copy of the relevant data, or a
> > reference to the relevant data, or both. And Java falls in the
> > second category.
You don't answer this point. Since something is always passed by value,
what is the point in saying a language "passes by value" when you mean
it in a sense in which ALL languages by their nature "pass by value".
> > In short, to say a language "passes by value" is to elevate a useless
> > distinction to a position where it merely confuses the issue.
>
> Gerry, please look at these sites:
>
> http://www.javaworld.com/javaworld/javaqa/2000-05/03-qa-0526-pass.html:
>
> "Q: If Java uses the pass-by reference, why won't a swap function work?
> A: Your question demonstrates a common error made by Java language
> newcomers. Indeed, even seasoned veterans find it difficult to keep the
> terms straight. Java does manipulate objects by reference, and all object
> variables are references. However, Java doesn't pass method arguments by
> reference; it passes them by value."
It is confusing because the terminology is pointless, suited only to
compiler writers. To pass references by value is to pass the things
referred to by reference. Spelling out that "Java passes references by
value" is okay, because we can separate both senses of the word
'reference'. Clearly, Java teachers, along with their language, have
created a generation of confused programmers. If your terminology
confuses everyone, why do you insist on using it, without even spelling
it out?
Explaining matters in terms of aliasing would be better. That way you
are not using terms that seem designed to confuse.
>- Gerry Quinn
- Next message: Mudge: "Re: OOP and memory management"
- Previous message: korsarz: "Re: which algorithm fits..."
- Maybe in reply to: Programmer Dude: "Re: What computer language is used a lot in the IT industry?"
- Next in thread: Corey Murtagh: "Re: What computer language is used a lot in the IT industry?"
- Reply: Corey Murtagh: "Re: What computer language is used a lot in the IT industry?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|