Jesse Silverman wrote:. . .
++I2; // auto=unboxing/boxing, now they are independent references to different heap objects...looks similar to value types, I guess works the same too...
. . .
Integers are immutable in Java® and values created by boxing may reuse objects if within a certain range. Yes, I think that is a value type. Everything may differ in different languages; I don't know enough to know what the differences are.
If we would pronounce this as "Assign I2 to refer to the value currently referred to by I1", which is increasingly something someone would be attempting to say, perhaps this is what caused their verbiage to shift to:
How does everyone pronounce the I2 = I1 operation in the first example? I will adopt that phrasing in the interest of community consistency.
In languages like Python that don't have primitive types as built-ins at all, you are essentially always doing that first operation all the time.
They might have switched their terminology in Python and then started back-applying it to Java/C++/C# even when dealing with primitives.
I am not sure, but I think all of the people I've heard say this do Python or Ruby or some other language with no primitive types, and apply the same pronunciation to primitive operations in Java/C#/C++.
Yes, I know that the third statement is describing a more complicated situation than the other two, but the end result is that it assigns a value to the variable I2. There's generally no need for me to go into the details of how the assignment works right away, although it might be important to discuss that later if it becomes a point of confusion.
Although you will have noticed that I'm a "terse" person whereas you aren't. So we differ about how to describe things which appear simple but have a bunch of annoying complexity hidden beneath.
I've decided that what is likely happening is that people also working in dynamic scripting languages see:
I2 = I1
as assigning another name or alias (Python explicitly does not use the term alias, but just name, even when aliasing) of I2 for the value which exists somewhere and is currently referenced by the name of I1.
So, assign (the name) I2 to (be another name for what is referenced by) I1.
They then carry that verbiage back to languages with primitives and call:
i2 = i1;
"assign i2 to i1"
Whether I am right or wrong on that guess, I don't like it much but have to deal with it, or just ignore all such sources, which cuts out too much from my diet, so too bad.
You showed up just in time for the waffles! And this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop