4 ms·
According to the following extract from 'Coders at Work', Knuth wrote the first version of Tex using pencil and paper: Seibel: Speaking of practical work, in t
by primodemus 16y ago
According to the following extract from 'Coders at Work', Knuth wrote the first version of Tex using pencil and paper:
Seibel: Speaking of practical work, in the middle of working on The Art of Computer Programming you took what turned into a ten-year break to write your typesetting system TeX. I understand you wrote the first version of TeX completely away from the computer.
Knuth: When I wrote TeX originally in 1977 and ’78, of course I didn’t have literate programming but I did have structured programming. I wrote it in a big notebook in longhand, in pencil. Six months later, after I had gone through the whole project, I started typing into the computer. And did the debugging in March of ’78 while I had started writing the program in October of ’77. The code for that is in the Stanford archives—it’s all in pencil—and of course I would come back and change a subroutine as I learned what it should be. This was a first-generation system, so lots of different architectures were possible and had to be discarded until I’d lived with it for a while and knew what was there. And it was a chicken-and-egg problem—you couldn’t typeset until you had fonts but then you couldn’t have fonts until you could typeset. But structured programming gave me the idea of invariants and knowing how to make black boxes that I could understand. So I had the confidence that the code would work when I finally would debug it. I felt that I would be saving a lot of time if I waited six months before testing anything. I had enough confidence that the code was approximately right.
Seibel: And the time savings would be because you wouldn’t spend time building scaffolding and stubs to test incomplete code?
Knuth: Right.
- hencq 16y agoThat seems like the kind of thing that would work if you're (a genius like) Knuth, but maybe not so much if you're me. Even though I like to take some time to draw things out on paper, I don't think I'd ever have the confidence (or the skill) to assume that it would just work.
- deleted 16y ago[deleted]
- ezy 16y agoI think text editors and "instant" compile environments have skewed our perspective a bit. I'd argue that it really doesn't take a genius to write out code longhand and have it work. What it takes is the discipline to write it slowly. The way people talk about it, it sounds like he just scrawled out a program..and it worked. But what he most likely did is think a lot, write a bit, erase, think a lot and write some more. It was written in pencil. I've personally found that if I force myself to stop, think and re-read code a lot -- not just fragments a few or 5 times, but the whole shebang in context 10 times over -- it's of consistently higher quality. Also, another way to view this is to pretend that's there's a high cost to typing it in the first place -- that helps too, but is harder to stick to :-). This seems to me to be a way of forcing your inner code reviewer to the fore.
- _delirium 16y agoI definitely notice that even for simple things. When I was pretty young, probably 8 or something, I was in a class where we had some time to play around with Logo when we finished other things. So I'd write up some stuff I wanted to try out on paper when I wasn't at the computer, and typed it in when I got to use the computer, and it worked pretty frequently. In theory I'm a much better programmer now than I was when I was 8, but I seem less good at writing chunks of error-free code that works on the first try, because there's this strong temptation to just instantly hit compile/run and see what happens, rather than writing it slowly and reading over it repeatedly.