Names, values, and variables
Computers store data in their memory. Each data element has two values associated with it – where it is, and what it is. In computer terms, where corresponds to the location (address) of the data in memory, and what corresponds to the value of that data. This is not rocket science, and matches everyday life – for example, I might have a bank account numbered 111023024 containing $890. Here, 111023024 is the “where,” and the $890 is the “what.”
Now, suppose I write 111023024 + 1. What exactly do I mean? Do I mean to add 1 to the account number to get 111023025 (which is a different account), or do I mean to add $1 to the number in this account numbered 111023024 to get $891? In everyday life, this is something that’s so obvious we just don’t think about it. In computing, we have to be a little more careful and think clearly about what we are doing.
Data elements are called variables because their...