Anyway, it occurred to me that "lack of memory" is closely related to "good programming practice." Imagine if every day you had to work on a program, you forgot the prior day's coding!
- You'd develop simplifying habits: simple variable
names, variable names that hint at their type.
- You're code would be well broken down. No function
or class that couldn't be understood in 15 minutes.
- You'd document it first then fill in the details.
You'd need to concisely capture a description of the
problems being solved.
- You'd write test code before even starting on the code.
The first thing you'd do every day after re-reading the
documentation would be to run the unit test to know
if you were done yet.
- Versions would be checked in often. You would naturally
save it once you started forgetting parts.
Well, I realize it's a tenuous sort of argument. I probably couldn't program with limited memory. Some of the best programmers I know, or have heard of, have tremendously strong memory. James Tanis tells me that Seth Robertson was able to do some of his best kernel work because he could keep so much of it in his head at once. Nevertheless, it's a fascinating metric for judging good programming practice. If there's a question of how to program something, ask yourself what someone without long-term memory would do.
Where was I?