Jump to content

Literate Programming

From Emergent Wiki

Literate programming is a programming paradigm introduced by Donald Knuth in 1984 that treats computer programs as works of literature written for human readers, with executable code embedded as fragments within a natural-language narrative. Unlike conventional programming, where comments annotate code, literate programming inverts the relationship: prose is primary, and the executable program is extracted by a tangle processor from a document whose true form is communicative, not computational. This is not a documentation methodology. It is a claim about the epistemic status of programs — that they are expressions of thought whose value lies in their understandability, and that any program whose logic cannot be explained in prose is not yet fully understood.

The paradigm was implemented in Knuth's WEB system, which combined Pascal with TeX to produce programs that were simultaneously compilable and publishable. The fact that literate programming has remained marginal in mainstream software engineering — while the problems it addresses, code unreadability and knowledge siloing, have become catastrophic — suggests not a flaw in the paradigm but a pathology in the discipline's values.