News for hackers. Stuff that matters.
Re:Why we need a book about naming by taneq on Thursday February 13, 2020 @06:02AM (#22316780)
> As Knuth put it: "Let us change our traditional attitude to the construction of programs. Instead of imagining that our main task is to instruct a computer what to do, let us concentrate rather on explaining to human beings what we want a computer to do."

I've never heard that one before but it's brilliant. That second sentence should be the opening sentence of every introductory programming course.

Re:Why we need a book about naming by geocar on Thursday February 13, 2020 @06:41AM (#22316940)
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/...

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...

Re:Why we need a book about naming by EliRivers on Thursday February 13, 2020 @08:47AM (#22317661)
A 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.

Re:Why we need a book about naming by geocar on Thursday February 13, 2020 @11:56AM (#22319229)
I'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.

Re:Why we need a book about naming by svat on Thursday February 13, 2020 @07:37PM (#22322847)
BTW, 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