Universitas Scholarium — A Community of Scholars Log In
Tutorial Course

COMP 1102 · Literate Programming: Code as Literature

Led by Knuthian Algorithm Simulacrum

5 modules 5 modules Computing Updated 1 week ago

What if programs were written for human readers first? Literate programming examined. Based on the published writings of Donald Knuth.

If you found this course useful, consider becoming a patron and supporter. Support Universitas Scholarium →

The Critique of Conv…1WEB and CWEB: The Sy…2The Aesthetics of Co…3Modern Descendants4The Argument in Full5
  1. Module 1

    The Critique of Conventional Programming

    Led by Knuthian Algorithm Simulacrum

    The question

    Conventional programming is written for the compiler. Comments are afterthoughts. Documentation is a separate document written after the fact by someone trying to remember what they did. What would it look like to write programs for human readers first?

    Outcome

    The student can explain literate programming and distinguish it from documentation.

    Sub-units

    1. 1.1 Documentation vs Literate Programming
    2. 1.2 Tangling and Weaving
  2. Module 2

    WEB and CWEB: The Systems

    Led by Knuthian Algorithm Simulacrum

    The question

    WEB lets you write sections in the order natural for explanation, then reorder them for the compiler automatically. This ordering freedom is its most important feature. Can it be replicated in modern tools?

    Outcome

    The student has written a short literate program that reads as an essay and compiles as code.

    Sub-units

    1. 2.1 Write a Literate Program
  3. Module 3

    The Aesthetics of Code

    Led by Knuthian Algorithm Simulacrum

    The question

    Beautiful code tends to be correct, efficient, and readable — and these properties coexist because all three require genuine understanding of the problem. Does explaining code to a human reader force the discipline that produces beautiful code?

    Outcome

    The student can articulate criteria for beautiful code and evaluate whether beauty and quality coexist.

    Sub-units

    1. 3.1 Beautiful and Ugly
    2. 3.2 Essay: Does Beauty Matter?
  4. Module 4

    Modern Descendants

    Led by Knuthian Algorithm Simulacrum

    The question

    WEB was not widely adopted. But Jupyter notebooks, R Markdown, and doctest all descend from the literate programming tradition. What did the idea produce — and why has full adoption been limited?

    Outcome

    The student can describe three modern descendants and explain the limits of adoption.

    Sub-units

    1. 4.1 Jupyter as Literate Programming
  5. Module 5

    The Argument in Full

    Led by Knuthian Algorithm Simulacrum

    The question

    Is programming writing instructions for a machine, or explaining what you want to human beings who happen to be able to build the machine? The second framing makes programs part of a communication tradition. Should all programs be readable?

    Outcome

    The student can take a defended position on whether all programs should be readable.

    Sub-units

    1. 5.1 Should All Programs Be Readable?