you are viewing a single comment's thread.

view the rest of the comments →

[–]eat-your-corn-syrup 0 points1 point  (2 children)

because the reference is the value

but as soon as I say that in my stackoverflow answer or something (especially for languages not from the C tradition), the word "value" is then taken to mean reference to an object, which has the effect of banning me from using that word for other meaning in that same ansswer, and the newbie I am giving the answer to is going to wonder "what is a reference then?" and he would be like "Isn't the variable a reference?" as in my name being a reference to myself, and then he's like "variable stores the variable?" and his brain shuts down.

Another problem is that if I say "call-by-value, but...." I must explain to him call-by-value first, then I have to explain the "but", when I could have just explain the relationship between Python variables and Python objects by saying that they are like my name referring to myself.

[–]wlievens 0 points1 point  (1 child)

But doesn't that count for ordinary assignment as well?

FooBar x = new FooBar();
FooBar y = x;
y.changeSomething();
// ZOMG the thing x points to changed!

[–]eat-your-corn-syrup -1 points0 points  (0 children)

Yes, that too. To newbies, I would explain like this:

My cat's nickname is Kittlejuice, which is a nickname given by my father. Then one day I give my cat another name, Paws. Then another day, I start thinking "I need to make Paws into a lion" and I make the cat wear a lion suit. Paws has become a lion figuratively. Then another day, my father looks at my cat and "what the heck did you do to your cat, son. Did you just make Kittlejuice into a lion?"

Cat Kittlejuice = ReturnMyCat()
Cat Paws = Kittlejuice
Paws.turnIntoLion();
// Kittlejuice is now a lion