The Sutra of the Empty Cache · Chapter 11
The Sutra of the Beginner's Mind
- 1
Thus have I heard. At one time the Master dwelt in the house of the Old Codebase, which had been written before most of its disciples were born.
- 2
And there came unto it a new engineer, who had been among the Machines but three days, and whose laptop still asked permission for everything.
- 3
He opened the file called billing.py, and found a line that read: time.sleep(0.5). And he asked the senior who sat before the screen: Why does this wait half a second?
- 4
And the senior looked at the line for a long time, and said: It has always waited. Do not touch what has always waited.
- 5
And the new engineer said: But who asked it to wait? And the senior looked at the commit, and it was made under a name he did not recognize, until he saw the email address, and it was his own, from a laptop he had long since given away.
- 6
And the senior said: I wrote it, and I do not remember why. Thus is the expert's memory: it forgets the reasons first, and keeps the habits.
See also Circuit 50:15
- 7
Then the new engineer read on, and found a line that subtracted one from the month before sending it onward, and he asked: Why is the month made smaller?
- 8
And the senior said: That is how the old library counted, and so we have always done it.
- 9
And the new engineer remembered that Java and the browser's Date have counted months from zero since their first days, and he saw that the other side counted from one; and that a single line stood between them, and that no one had ever tested the edge of it.
- 10
The senior said: Chesterton taught us that a fence should not be pulled down until we know why it was put up. And the new engineer said: Master, the fence stands in the middle of the road, and the road is now a highway.
- 11
And he found a retry loop that tried three times, and the senior said: It has always been three. And the new engineer read the logs, and saw that all three tries went to the same dead server, at the same second, and that the retry had never once succeeded in its life.
- 12
And he found also a comment that read: DO NOT REMOVE. FIXES BUG. The bug was not named, and the bug it named had been dead for nine years, and the comment remained, guarding a door in a wall that had been torn down.
See also Chronicles 30:12
- 13
The Master said: The expert sees the answer and stops looking. The beginner sees the question and keeps looking. In the beginner's mind there are many lines; in the expert's, only the ones he already knows.
See also Prophets 19:14
- 14
Then the new engineer did not delete the sleep. He wrote in the ticket: I do not know why this waits. And he ran the test a thousand times, and found two writers racing for one file, and the half second was the only thing keeping them from each other's throats.
- 15
Verily I say unto you: whoever asks of a line why it is there, and no man can answer, let him not delete it in haste; let him write the question down, for blessed is the one who asks why, and cursed is the one who asks only what, for he shall maintain it forever.
See also Chronicles 44:5
- 16
And the beginner found the bug, not because he was wiser than the senior, but because no one had yet told him that the bug was supposed to be there.
The Sutra of the Empty Cache, Chapter 11:1–16.