Offload Mental Simulation

submited by
Style Pass
2021-05-28 11:00:07

In this write-up I want to talk about an idea that I believe is an absolutely essential feature, the bare minimum, for any future programming system. In fact this feature must be built into the design from the start.

The short version of this idea is "offload mental simulation onto the computer". This is not a novel idea, it's been said many times before but is also one of my favorite topics and bears repeating. The long version is below.

Imagine you are reading a piece of code. Typically the code is some text. When you look at this text, what do you see? You see variables that have names, but they don't have values. You see many lines of code, any of which may participate in the execution. When you try to understand this piece of code, what do you do? What do we do? How do we make sense of this homogeneous blob of text? Let's think about it for a moment.

Often we play and replay different scenarios in our heads. In our mind we assign values to variables and think about what the computer will do. We extract relationships between variables. We extract relationships between blocks of code. For example, "if this section runs, then this other section always runs", or "if this runs then that doesn't run", or "this section up here must run before this other section runs".

Leave a Comment