the great mathematician, Paul Erdős, used to talk of The Book, the one where God put all of the most elegant proofs of Mathematics. sometimes he would see a proof but say that we must find the proof from The Book, because while the given proof was correct, it was clear that something greater existed.
A perspective of this level is one I have never seen in programming, but it’s definitely something I started feeling recently.
While trying to solve some programming problem, I had multiple potential solutions that all could have worked, but I didn’t like any of them. All the solutions I had in mind felt contrived; ugly. They raised complexity and I could feel the rest of the system fighting them.
I took a break and did nothing for a bit (as I often do when stuck)…and then it hit me. An idea came to me that was so elegant, optimal, and fit so beautifully with everything else that the experience of seeing it can only be described as a shock. A shock so great I still think about it many days later, and writing an article about it.
it’s a moment that felt like seeing something from The Book, The Book of the best, most elegant programs.
Unfortunately, it is practically impossible to convey this experience. It requires very specific context about my understanding of the codebase, of the project (it was Overlord Systems), details about the solution, and all the invisible constraints tying everything together.
it is good to ship a program to people knowing that, at least for one moment in time, it contained a program of The Book within it.
P.S. given that programs are mathematical proofs, as per the Curry-Howard correspondence, are The Book of proofs and The Book of programs, actually one and the same?