Reducing Programmer’s Cognitive Overload
Probably the biggest cost of programming is to keep it all in mind, wouldn’t it be great to reduce it?
Programmers heavily depend on their short-term memory to complete their tasks. They need to keep variables and state in mind, they need to simulate the program operating in their head. Each character they write has consequences and must be sewn to the rest. Because of it, it is not a strange to see that a developer needs up to fifteen minutes to plan what he will write. And we have seen it, interrupting a programmer while coding is disastrous. In just a second, we can erase all his short-term memory and force him to start loading all again.
But recently, I have observed something new, something unexpected while I was giving a course for new-programmers.
I was teaching the If-conditional instruction. This instruction is the one that allows the computer to take decisions by itself, and decide what to do without human supervision. Yet, that means that the programmer has to anticipate those scenarios and decide how the computer will react in each one. But the complexity of the If-conditional can grow exponentially: 1 if have two cases, 2 ifs have four, 3 ifs have eight, 10 ifs have…