Literate Programming

E94988

Literate Programming is a programming paradigm introduced by Donald Knuth that emphasizes writing code as an explanatory narrative for humans, with machine-executable instructions embedded within the documentation.


Statements (49)
Predicate Object
instanceOf programming paradigm
software development methodology
appliedIn algorithm description
educational code examples
scientific computing
contrastsWith comment‑as‑afterthought documentation
traditional code‑centric programming
creator Donald Knuth NERFINISHED
describedIn “Literate Programming” (1984 paper)
designPrinciple order of exposition follows explanation, not execution
programs should be written for humans first, machines second
emphasizes chunking code into named sections
natural language explanation of code
top‑down program description
weaving documentation and code together
goal improve program maintainability
improve program readability
support human understanding of programs
hasCriticism can be time‑consuming to apply in practice
tooling can be complex or language‑specific
inception early 1980s
influenced CWEB
Jupyter notebook style workflows
WEB NERFINISHED
literate Haskell
noweb
org‑mode Babel
reproducible research practices
influencedBy Donald Knuth’s work on MIX and MMIX
Donald Knuth’s work on TeX
involves tangling step to produce compilable source code
weaving step to produce human‑readable documents
languageAgnostic true
mainIdea documentation is primary, code is secondary
programs are written as explanatory narratives for humans
source code is embedded within documentation
notableTool CWEB NERFINISHED
WEB NERFINISHED
noweb NERFINISHED
relatedTo documentation‑driven development
executable documentation
notebook‑based computing
requires preprocessing step before compilation
supports mixing prose, code, and markup
typicalOutput machine‑executable source files
typeset documentation of programs
uses literate programming tools
tangle tools
weave tools

Referenced by (4)
Subject (surface form when different) Predicate
CWEB ("literate programming")
basedOnConcept
Literate Programming ("“Literate Programming” (1984 paper)")
describedIn
Donald E. Knuth
notableWork
RStudio ("Sweave")
supportsDocumentFormat

Please wait…