Programming paradigm introduced by Donald Knuth (1984) in which a computer program is given as an explanation of its logic in a natural language, embedded with code chunks, from which compilable source code can be generated.
(Adapted from Wikipedia )
What to say. Literate programming emphasises writing for humans first: the logic is explained clearly in prose, with computer code embedded for execution. The document is the analysis, so text, code and results never drift apart. Quarto and R Markdown documents are literate programs in this sense: the document can be turned into the executable analysis and into the readable report.
Teaching cues (~2 min). Likely question: is this the same as comments in code? No: here the prose is the main text and the code is embedded in it, while comments are small notes inside code. Next: the tool we use, Quarto.
Idea of the slide. A definition of literate programming, adapted from Wikipedia: a programming paradigm introduced by Donald Knuth in 1984 in which a program is given as an explanation of its logic in natural language, with embedded code chunks from which compilable source code can be generated. The picture is the cover of Knuth’s book Literate Programming.