3 ms·
Knuth's approach to code is quite remarkable and also rather unique. Here's one of his most famous programs in source code form: http://anorien.csc.warwick.ac.
by geocar 7y ago
Knuth's approach to code is quite remarkable and also rather unique. Here's one of his most famous programs in source code form:
http://anorien.csc.warwick.ac.uk/mirrors/CTAN/systems/knuth/dist/tex/tex.web http://anorien.csc.warwick.ac.uk/mirrors/CTAN/systems/knuth/...
Yes that's right, 1mb of source code text, all in one file.
If you haven't had the pleasure of a well-considered literate program, it might be funny to hear that I'd actually prefer this to a lot of shit I have had to deal with in my life...
- EliRivers 7y agoA well-written literate program is a joy to work with. To be able to genuinely understand a complex program's design by reading well-written prose which forms part of the source code. Literally reading code like a book, finding that it effectively has a plot and characters with understandable motivations, properly introduced and their places and relationships clearly understood. Done right, it can work so well. The only software I ever worked on in which the customer never reported a single bug was written entirely in literate code. The software I work on now is so much at the other end of the scale that sometimes when the customer reports something, there is a signficant period of investigation before deciding if it's a bug or if that's how it's meant to work.
- geocar 7y agoI'm in 100% agreement. Literate programs can be a real treat, but I also think to add: So can any code. Reading someone's code feels like peering into another persons head, trying to imagine both what they must have been imagining. Sometimes that can be a real scary thing, but for those of us who like a good haunted house, it can be a real treat too.
- svat 7y agoBTW, that .web file is not meant to be read directly (even Knuth doesn't read that file, except to make edits). The form in which it supposed to be read, and the form in which it was published as a book (though with some added typographical/indexing niceties) is the "woven" form, e.g. what you can find here: http://texdoc.net/texmf-dist/doc/generic/knuth/tex/tex.pdf http://texdoc.net/texmf-dist/doc/generic/knuth/tex/tex.pdf