nutcroft

In defense of mind-executed algorithms

Once upon a time there was a programming course in Imagined Pascal. In this course, the exercises were exclusively algorithmic. To solve them, you couldn't use a computer. This was an imagined language after all. You could only use your mind.

It seemed unintelligent and in vain to run programs in your mind. The computer could run them in milliseconds and verify the unmistakable correctness of the solutions instantly.

But lately I have been thinking that when I was taking that course, I enjoyed programming more than ever. Isn't it weird? By using only paper and mind, I had to think exactly what the code would do, every possible scenario, with every possible value of every variable. As there was no compiler to catch me, I could get away running my potentially wrong execution path. But gradually testing all the execution paths when some of them were wrong was more fun when the compiler wasn't there to scream at me for not catching all possible trails from the beginning.

The final ingredient of this type of entertainment is the existence of a teacher. The guarantee that one couldn't get away with a non-exhaustive mind execution.