Literature Lab

Code as Writing

The Poetics of the Source File

Philosophy

Programs are read by humans first.

Computer science operates under a collective delusion. We pretend code is written exclusively to orchestrate silicon logic gates. We evaluate syntax entirely by its efficiency, memory footprint, and execution speed. This perspective is fundamentally incomplete.

In 1984, computer scientist Donald Knuth published a paradigm shift titled Literate Programming. His core thesis was radical. He argued that we must change our attitude regarding the construction of programs. Instead of imagining that our main task is to instruct a computer what to do, we must concentrate on explaining to human beings what we want a computer to do.

When you open a source file, you are opening an essay. The document has two entirely separate audiences. The compiler requires flawless mechanical grammar. The human reader requires narrative arc, comprehensible naming conventions, and spatial organization. The act of writing generation logic is a literary exercise.

Close Reading

1. The Vocabulary of Function

When an artist creates generative work, their aesthetic signature begins before the pixels hit the screen. It begins in the stylistic choices made within the IDE. Let us engage in a close reading of three distinct aesthetic paradigms in software writing.

Select the highlighted lines below to analyze the editorial choices embedded within the mathematics.

algorithm_01.js [Zach Lieberman style]
1
let particles = []; // Flow state
2
function draw() {
3
let t = millis() * 0.001;
4
let radius = map(sin(t), -1, 1, 50, 150);
5
circle(mouseX, mouseY, radius);
6
}
Select a highlighted line to read annotation.
This panel reveals the literary mechanics behind the algorithmic structure.
shader_02.glsl [Inigo Quilez style]
1
void mainImage(out vec4 fragColor, in vec2 fragCoord) {
2
vec2 uv = fragCoord/iResolution.xy;
3
vec3 p = vec3(uv, iTime);
4
float d = length(p) - 0.5; // SDF bound
5
fragColor = vec4(vec3(d), 1.0);
6
}
Select a highlighted line to read annotation.
Observe the shift in dialect from JavaScript to Shader Logic.
behavior_03.pde [Casey Reas style]
1
class Boid {
2
PVector location, velocity, acceleration;
3
void flock(ArrayList boids) {
4
PVector sep = separate(boids);
5
PVector ali = align(boids);
6
applyForce(sep); applyForce(ali);
7
}
8
}
Select a highlighted line to read annotation.
Notice how object-oriented programming changes the grammatical structure.

2. Translation Tool: Syntax to Prose

We forget that programming languages are exactly that. Languages. They possess nouns (variables), verbs (functions), and punctuation (syntax). If we treat a file not as a machine blueprint but as an essay written in a hyper-formalized dialect of English, we can translate it directly into prose.

function setup() { createCanvas(windowWidth, windowHeight); noStroke(); fill(200, 20, 50, 150); } function draw() { for(let i=0; i<300; i++) { let x = sin(frameCount * 0.05 + i) * 100; ellipse(x, height/2, 5, 5); } }
Aesthetics

3. Verbose vs Cryptic

The visual style of the art generated often mirrors the visual style of the text that generated it. Consider these two identical algorithms yielding the exact same visual output. The narrative tone, however, is entirely different.

Verbose (Narrative)
const maximumRadius = 500;
const expansionSpeed = 0.05;

let currentSize = 0;

function drawFrame() {
  if (currentSize < maximumRadius) {
    currentSize += expansionSpeed;
    drawCircleAtCenter(currentSize);
  }
}

Favors extreme legibility. The author writes assuming a future collaborator will need to instantly understand the mechanics without spending mental calories decoding abbreviations.

Cryptic (Mathematical)
const R = 500;
const dr = 0.05;

let r = 0;

function draw() {
  if(r < R) { r += dr; circ(0,0,r); }
}

Favors density. The author treats the text editor like a chalkboard in a physics department. By removing noise and whitespace, the underlying structural logic is visible instantly at a glance.

4. Editorial Review Engine

Paste a block of your own generative logic below. The engine will not execute the code. It will perform a heuristic semantic analysis of your naming conventions, architectural depth, and marginalia. It will attempt to read your code strictly as poetry.

Conclusion

To Write is To Design

The code you write does not merely instruct the machine. It projects an ideology about what programming is supposed to be. When you collapse a nested loop into an elegant map function, you are editing for cadence. When you choose to name a vector acceleration instead of a, you are making a stylistic assertion.

The next time you open a source file, do not immediately scan for logic errors. Read it straight through. Listen to the rhythm of the indentations. Notice where the author felt compelled to leave a comment out of guilt, or where they trusted the variable name entirely. You are reading literature.

Zach Lieberman on poetic computation: how code, design, hardware and theory intersect in a practice that treats software as a literary medium.

References

Sources & Further Reading

  1. [1] Knuth, D.E. (1984). Literate Programming. The Computer Journal, 27(2), 97–111. Oxford University Press. doi:10.1093/comjnl/27.2.97
  2. [2] Knuth, D.E. (1992). Literate Programming. CSLI Lecture Notes, No. 27. Stanford University Center for the Study of Language and Information. ISBN 978-0-937073-80-3.
  3. [3] Reas, C. & Fry, B. (2007). Processing: A Programming Handbook for Visual Designers and Artists. MIT Press. ISBN 978-0-262-18262-1.
  4. [4] Reas, C. & McWilliams, C. (2010). Form + Code in Design, Art, and Architecture. Princeton Architectural Press. ISBN 978-1-56898-937-8.
  5. [5] Quilez, I. (2019–2025). Articles on shader mathematics and signed distance functions. Personal site. iquilezles.org/articles
  6. [6] Lieberman, Z. & Parrish, A. (2015). School for Poetic Computation. SFPC. sfpc.study
  7. [7] McConnell, S. (2004). Code Complete: A Practical Handbook of Software Construction (2nd ed.). Microsoft Press. (Chapter 11: The Power of Variable Names.) ISBN 978-0-7356-1967-8.
  8. [8] Martin, R.C. (2008). Clean Code: A Handbook of Agile Software Craftsmanship. Prentice Hall. ISBN 978-0-13-235088-4. (On naming as design.)
  9. [9] Cox, G. & McLean, A. (2013). Speaking Code: Coding as Aesthetic and Political Expression. MIT Press. ISBN 978-0-262-01836-4.
  10. [10] Montfort, N. et al. (2013). 10 PRINT CHR$(205.5+RND(1)); : GOTO 10. MIT Press. (A book-length close reading of a single line of BASIC code.) 10print.org
GenLab Editor

Written by GenLab Editor

Creative coder, digital artist, and tech researcher analyzing the intersections of code, design, and machine logic. Exploring the philosophical implications of emerging technologies.

Continue Reading

Related Protocols