Donald Knuth: How The Art of Programming Was Created (33.38.39 / 97)
- Transfer

In my third year at university, I was asked to give a couple of classes on computers. A group of people said that Caltech (California Institute of Technology) did not teach anything related to computers. During this time I advised Burroughs. “So why don't you have a couple of classes at the university?” They asked me. So I conducted the lesson only once, and before graduating from university, they decided to hire me as an assistant professor, immediately after graduation.
Usually, university does not hire its own graduates, with the exception of MIT. But as you know, it is considered not good to do inbreeding (incest), because separation can get bogged down in one philosophy, and they want “fresh blood”. But Caltech found me strange and alien enough "by blood", and this was a positive argument to hire me.
How the idea of the book came about
(1:04) Meanwhile, in January 1962, there was my second year at university and the first year of marriage with my wife. We got married in the summer of 1961. Jill and I lived for 6 months in bliss. We spent a honeymoon and then we had some more time to be together until I was immersed in writing a book on computer science.
In January 1962, an editor from Addison-Wesley invited me to dinner and said: "We would like to invite you to write a book about compilers." (Compilers are what I did for Burroughs the whole previous year.)
Addison-Wesley is an American computer literature publisher that has previously published science literature. Belongs to the Pearson media concern.
“You were recommended to us as someone who knows how to write compilers, and you think about writing a book?” Previously, I worked for various newspapers and magazines, wrote several articles. I always liked to write. And so the publisher of my favorite textbooks, Addison-Wesley, asks me to write a book.
(3:00) I immediately went home and wrote down the title of the 12 chapters and thought it would be nice if the book would be just that. I thought I could finish the book pretty quickly. I have a letter that I wrote in 1964 in response to an invitation to one university: “Unfortunately, I cannot visit Stanford University this year because I have to finish the book before my son is born.
Now he is 40 years old, and I still have not finished the book ... I would like to finish it faster, but I had no idea how and how much time I would still need. I was asked to write a book about compilers, but I said: “Wait a minute, there are a bunch of things that happen in computer programming that you should be aware of too.” And they said they didn’t mind if other topics related to programming were covered in the book.
We decided to call the book The Art of Computer Programming. Publishers liked the name.
I decided to write “The Art of Programming” not because I like to write, but because I felt an urgent need for such a book. Nothing of the kind existed at that time. Although I wrote several compilers, and I knew a lot about them, I did not come up with any original idea in this area. I just applied the ideas that I learned from other people. And I began to wonder who would be able to write a book about compilers, but I found all candidates to be biased and focused only on their approach.
I found only one candidate worthy for such a job that he would not write biasedly - himself.
Underestimating the size of books
The draft table of contents contained 12 chapters. From day one, I began to fill out chapter after chapter and write more material, and in the meantime, computer science was rapidly developing. It turned out that I greatly underestimated how long the work could last. At the end of writing, I looked at my notes, they were all written by hand, and it seemed to me that my notes are much more than the book itself. Actually I ... I got to the end of chapter 12, I had 3,000 pages. And I just planned 64-65 chapters ...
I have accumulated 3,000 handwritten pages. I wrote to Addison-Wesley and asked if they would mind if I supplemented the book with materials that I had unearthed. To which they answered: "Come on."

(1:36) 3,000 pages. I took a typewriter and started typing. The first chapter had 400 pages of machine text, and this at two intervals. By the way, I was typing on IBM Selectric. At that time, it was one of the best typewriters. As I was told later, I was the first private, not corporate buyer of such a machine. The beauty is that it was implemented "buffer". That is, you could enter a new letter while the previous ones were not yet printed. For the first time I saw such a machine at the exhibition and tried to print a couple of sentences. I was delighted. And so I bought Selectric and used it for my dissertation at the California Institute of Technology. It was as if I were a man behind the keyboard: I played the piano, the saxophone, so it was just another machine with keys.
(3:50) I started typing, typed the first chapter of twelve, and sent it to Addison-Wesley, saying, “This is the first chapter of my book.” Then I received a letter from a person who was actually the first editor who spoke to me in 1962. But that was 1966, I think by that moment I already had 3,000 pages plus a typed chapter. And now I heard the same guy again, but he was promoted three steps in the company during this time, so now he was on his way up. And, you know, he said: “What is happening? "Your book, Don, do you understand that your book will take more than 2000 pages?"
What? I thought I had six or seven hundred pages in a book. I said, you know, I thought: “I’ve read books for years. How can you tell me this book will be so long? ” So I went back to “Thomas's Calculus” (matan textbook), the original book that I adored in my first year at college, and printed.
I felt that the five pages that I print would turn into one page in a book, but they said, "No, no, one and a half to one." I could not believe it. So I took “Thomas's Calculus” and printed 2 pages from there on my typewriter. Exactly, the three pages of typescript turned into two.
I had a book three times bigger than I expected. No wonder it took me so long to finish this thing. But then they said: "No one can master this book." You know, all publishers have horror stories about professors who send them manuscripts in 10 volumes about the history of eggs or something, and they just lie. So how are they going to get around this?
First edition
I flew to Massachusetts to discuss our future plans. The guys from the publishing house said: “Well, we’ll come up with something,” although they have already managed to show this chapter to several people who really liked it and didn’t really doubt it. However, during lunch, I noticed with my then editor, Norm Staton, in my personal notes “strict budget constraint” or something like that. He apparently wanted to softly bring me to this news, and suggested ... That is, they suggested not to bother writing answers to the exercises, but instead of professional illustrations, insert those that I myself drew in manuscripts. The guys said they were “fascinated” by them. I honestly thought then that they were drunk or high. “No,” I said, “you know why I like Addison-Wesley?” Because the quality of their books is just that, what should be - magnificent, and illustrations in them - at the proper level. And that is why I signed a contract with you guys! ” After this conversation, my editor came up to me and said:
“You were fearless and persistent, standing in front of the campaign director, well done, boy!”
And so on. Then they decided to print this book in three volumes, but then their opinion changed, and they decided to release it in seven volumes ... In general, the plan for publishing the book “The Art of Programming” in seven volumes was approved. And we still officially adhere to this plan, but in the last 30 years only 3 volumes have been released. Now I'm working on the fourth.
Computer science is a very vast field, and the 3000 pages that I wrote earlier described its status only in 1965. But since then a lot of time has passed, I studied some of its other aspects, which were also worth including in the book. Thus several more stages passed. Also, the guys asked me not to include answers to the exercises in the book; It was thought that they would be published separately, in a paperback, and would be printed on a typewriter. However, the editors decided to print the answers along with the rest of the text. And finally, in 1968, the first volume was released. And it was estimated, to put it mildly, expensively - as much as $ 32! When the rest of the computer science books were worth $ 10. And what is striking, in the first year the book gained great success, 50 universities approved it as a textbook. And although reading it was not easy,
And so the story of “The Art of Programming” began. In 1968, I first received copies of the first volume. Since then, about 400,000 more copies have been sold in English and much more in other languages. I could not believe that this book would become so popular. But if in 1962 I knew that at 68 I would still continue to work on it, I would definitely abandon this venture. To be honest, I generally thought that I would finish in 1965, right before the birth of my son.
To be continued ...
Translation: Alena Karnaukhova, Katya Shershneva and Nikita Gladyshev
Read more
- Donald Knuth: I sat at the back desks and bullied jokes, and the teachers humbled themselves and didn’t beat their asses often (1,2,3,7 / 97)
- Donald Knuth: “My Advice to the Young” (93/97) and “Feeling the need to assert themselves” (9/97)
- “Surreal numbers”: I worked for six days, and rested on the seventh (40,41,42 / 97)
1. Family history
2. Learning to read and school
3. My mother
4. My parents' finances
5. Interests in high school
6. Being a nerd of nerds at high school
7. My sense of humor
8. The Potrzebie System of Weights and Measures
9. Feeling the need to prove myself
11. University life: my basketball management system
12. University life: the fraternity system
13. Meeting my wife Jill
14. Bible study at university and a time of personal challenge
15. Extra-curricular activities at Case
16. Taking graduate classes at Case
17. Physics, welding, astronomy and mathematics
18. My maths teacher at Case and a difficult problem
19. My interest in graphs and my first experience of a computer
20. How I got interested in programming
21. Learning how to program on the IBM 650
22. Writing a tic-tac-toe program
23. Learning about Symbolic Optimum Assembly programs
24. The Internal Translator
25. Adding more features to RUNCIBLE
26. Wanting to be a teacher and why I chose to go to Caltech
27. Writing a compiler for the Burroughs Corporation
28. Working for the Burroughs Corporation
29. Burroughs Corporation
30. My interest in context-free languages
31. Getting my PhD and the problem of symmetric block designs with ...
32. Finding a solution to an open problem about projective planes
33. Inception of The Art of Computer Programming
34. 1967: a turbulent year
35. Work on attribute grammars and the Knuth-Bendix Algorithm
36. Being creative in the forest
37. A new field: analysis of algorithms
38. The Art of Computer Programming: underestimating the size of the ...
39. The successful first release of The Art of Computer Programming
40. Inspiration to write Surreal Numbers
41. Writing Surreal Numbers in a hotel room in Oslo
42. Finishing the Surreal Numbers
43. The emergence of computer science as an academic subject
44. I want to do computer science instead of arguing for it
45. A year doing National Service in Princeton
46. Moving to Stanford and wondering whether I'd made the right choice
47. Designing the house in Stanford
48. Volume Three of The Art of Computer Programming
49. Working on Volume Four of The Art of Computer Programming
50. Poor quality typesetting on the second edition of my book
51. Deciding to make my own typesetting program
52. Working on my typesetting program
53. Mathematical formula for letter shapes
54. Research into the history of typography
55. Working on my letters and problems with the S
56. Figuring out how to typeset and the problem with specifications
57. Working on TeX
58. Why the designer and the implementer of a program should be the ...
59. Converting Volume Two to TeX
60. Writing a users' manual for TeX
61. Giving the Gibbs lecture on my typography work
62. Developing Metafont and TeX
63. Why I chose not to retain any rights to TeX and transcribed it to ...
64. Tuning up my fonts and getting funding for TeX
65. Problems with Volume Two
66. Literate programming
67. Re-writing TeX using the feedback I received
68. The importance of stability for TeX
69. LaTeX and ConTeXt
70. A summary of the TeX project
71. A year in Boston
72. Writing a book about the Bible
73. The most beautiful 3:16 in the world
74. Chess master playing at Adobe Systems
75. Giving a lecture series on science and religion at MIT
76. Back to work at Stanford and taking early retirement
77. Taking up swimming to help me cope with stress
78. My graduate students and my 64th birthday
79. My class on Concrete Mathematics
80. Writing a book on my Concrete Mathematics class
81. Updating Volumes One to Three of The Art of Computer Programming
82. Getting started on Volume Four of "The Art of Computer ...
83. Two final major research projects
84. My love of writing and a lucky life
85. Coping with cancer
86. Honorary doctorates
87. The importance of awards and the Kyoto Prize
88. Pipe organ music is one of the great pleasures of life
89. The pipe organ in my living room
90. Playing the organs
91. An international symposium on algorithms in the Soviet Union
92. The Knuth-Morris-Pratt algorithm
93. My advice to young people
94. My children: John
95. My children: Jenny
96. Working on a series of books of my collected papers
97. Why I chose analysis of algorithms as a subject
Support for publication is Edison , a company that develops a web interface for controlling a radio relay station , and also designs and develops software for recording and analyzing heart rate variability .