In 1956, George A. Miller published “The Magical Number Seven, Plus or Minus Two: Some Limits on Our Capacity for Processing Information” in Psychological Review. This paper argues that the number of objects an average human can hold in working memory is 7 +/- 2. This paper also discusses memory span, which is the longest list of items (digits, letters, words) that a person can repeat back immediately after presentation in correct order on 50% of trials. Again, Miller notes that the number is 7 +/- 2.
More recent research (Cowan – 2001) has put the limit of the “focus of memory” (working memory) at 4 “chunks.” Oberauer in 2002 refined Cowan’s model by saying we have a more narrow focus of attention, a one-element focus that is embedded in the four-element focus that can be selected for processing (which sounds suspiciously like single-threaded consciousness). There are numerous other models of the organization of memory; interested readers should research “working memory” on the internet. The “Useful Resources” page on this blog also contains other resources.
Which means that when we are developing a program using programming languages, we start running out of chunks somewhere around punctuation and spelling. Even worse, if each perspective consumes 1 chunk (Global perspective = 1, Detail perspective = 1, Positive branch = 1, Negative branch = 1 for a total of 4 chunks) then we’ve already used up all of the available chunks of memory when we start processing our first IF statement. The issues our brains must hurdle with when using programming languages are listed below:
- Global vs detail perspective
- Conditional Statements (Positive Branch vs Negative Branch)
- Defensive Programming (Optimist vs Pessimist)
- Writer vs Debugger
No wonder it is so difficult to develop computer programs using programming languages; our brains have too much to keep track of and end up having to dump one chunk to bring a different chunk into working memory, like a computer system that has exceeded its RAM and has to access its virtual memory on disk. Worse, our biological RAM is time limited; unused items are either partially remembered or completely forgotten. At least electronic RAM can do parity checking and alert us when the memory contents are corrupted or lost.
It is time that we admit that our single-threaded brains simply can’t simultaneously perform all of the activities that programming languages require of them. And it goes a long ways towards explaining why, despite many decades of experience using programming languages, we’re not that much more efficient or productive at developing software than we were in the beginning.