DELAPARRA
Index
Color
NL
Category: Programming paradigms

Literate Programming

Explained by Updated

What is Literate Programming?

Literate Programming: Rather than writing code first and comments as an afterthought, you write a narrative document aimed at a human reader, with code fragments embedded in it. Tools then 'tangle' the code into a runnable program and 'weave' the prose into readable documentation. Literate programming, introduced by Donald Knuth, turns the usual order around. You write a document for people, explaining the program in whatever order makes sense to a reader, with pieces of code embedded in it. Tools then extract the code into a runnable program and format the text into documentation.

Definition source Coders Lingo, CC BY 4.0

Frequently asked questions about Literate Programming

How is Literate Programming used in practice?

The idea is that a program is something to explain, not just something to execute. Design decisions and reasoning sit right next to the code they shaped.

What should you keep in mind with Literate Programming?

Pure literate programming is rare in business software, but its influence is everywhere. Jupyter notebooks, documentation sites built from Markdown with live examples, and well-written README files follow the same spirit. Even in ordinary code, comments that explain why, not what, bring some of its benefit.

At a glance

CategoryProgramming paradigms
Explained by
Updated

More Programming paradigms terms

All terms starting with L

Skills

Download all skills (zip)

Manuals

Related services

Need any help?

Stuck on one of these in your own project? Tell me what you are working on and I will tell you how I would approach it.