Copy Semantics versus Pointer Semantics

One problem with languages that use pointers, either directly or indirectly, is the temptation to use pointer semantics for assignment. When an assignment is performed, is the entire contents of the source copied over into the target, or is it simply the case that the source and the target end up pointing to the same value.

Oftentimes languages find it easier to adopt the later approach. This is called pointer semantics, or sometimes reference semantics, and is found in Smalltalk and Java.

[audio] [real] Text to accompany slide13, in Chapter 12 of An Introduction to Object-Oriented Programming