Typing

A variable is simply a name. It is a handle we use in a programming language to get hold of a value.

A value is a string of bits in memory.

Types can be related either to variables or to values. In a staticly typed language, such as C++ or Pascal, a type is associated with a variable. This happens at compile time. In a dynamically typed language, such as Smalltalk, variables do not have types, but values do. A type is associated with a value. Thus, in Smalltalk, we can say that a variable is currently holding a real number, but not that a variable IS a real number. Later, it can be assigned to a different value, and its type can change.

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