jargon

Design patterns·Objects, messages and the principles

you passed it to a function, the function changed it, and your copy changed too — or it did not, and you had to know which.

Reference vs value semantics

Also calledreference semantics, value semantics, pass by reference vs pass by value

Whether assigning or passing something shares one object or produces an independent copy. It decides whether aliasing is possible at all, and therefore whether defensive copying, immutability and thread-safety are concerns in a given piece of code. Most mainstream languages are reference-semantic for objects and value-semantic for primitives, which is exactly enough inconsistency to catch people out at a boundary.

Commonly confused with