---
title: "Writing a line and keeping it"
url: "https://www.mikefluff.com/en/experiments/nw-ch03-line-cost"
locale: "en"
author: "Mikhail Savchenko (Mike Fluff)"
updated: "2026-11-22"
description: "Technical debt: the cost of writing code vs keeping it"
book: "https://www.mikefluff.com/en/books/nobody-writes-code"
alternates:
  - locale: "en"
    url: "https://www.mikefluff.com/en/experiments/nw-ch03-line-cost"
    markdown: "https://www.mikefluff.com/en/experiments/nw-ch03-line-cost.md"
  - locale: "ru"
    url: "https://www.mikefluff.com/ru/experiments/nw-ch03-line-cost"
    markdown: "https://www.mikefluff.com/ru/experiments/nw-ch03-line-cost.md"
  - locale: "pt"
    url: "https://www.mikefluff.com/pt/experiments/nw-ch03-line-cost"
    markdown: "https://www.mikefluff.com/pt/experiments/nw-ch03-line-cost.md"
  - locale: "es"
    url: "https://www.mikefluff.com/es/experiments/nw-ch03-line-cost"
    markdown: "https://www.mikefluff.com/es/experiments/nw-ch03-line-cost.md"
---

# Writing a line and keeping it

*Technical debt: the cost of writing code vs keeping it*

## What is technical debt?

Technical debt is the future cost of code that was quick to write. Every shortcut, duplicate and unexplained workaround has to be read, understood and worked around by whoever changes the system next. Ward Cunningham coined the term in 1992, comparing shipping imperfect code to taking out a loan; the interest is the extra effort each later change costs. With language models writing code for cents, the loan has become almost free to take out. The interest has not changed.

The book starts from the fact that writing code became almost free and keeping it did not. This calculator puts the two prices on one scale. A line of ordinary code takes a model about ten tokens, and in autumn 2026 the cheapest models charge about 13 cents per million output tokens, so a million lines comes to roughly a dollar. A model you would trust with real work costs some thirty times more.

The chapter has one price for upkeep. It comes from Charles Fishman’s 1996 article on the group that wrote the Space Shuttle’s flight software, which cost 35 million dollars a year for 420 thousand lines, more than 80 dollars a line, every year the program lived. That group kept one of the most carefully checked programs of its day, so the rate sits high, but it is the only real figure the chapter has.

The slider runs from a thousand lines to ten million, and the two presets jump to a million lines and to the size of the shuttle’s code. The bars are on a log scale, each mark ten times the one before; on an ordinary scale the writing bars would not show at all. The line under the bars compares a year of keeping with the cheap writing, and the gap comes out at almost a hundred million times. The ten-year bar adds another order on top.

In 1988 Edsger Dijkstra suggested booking lines of code as spent rather than produced. The scale shows what he meant. Writing is paid once and keeping is paid every year, so a model that writes a similar new piece instead of finding the old one adds to the column that never closes.

_The page has an interactive experiment that runs in a browser: https://www.mikefluff.com/en/experiments/nw-ch03-line-cost_

## Sources

- [Ward Cunningham, The WyCash Portfolio Management System (OOPSLA 1992)](http://c2.com/doc/oopsla92.html)
- [Technical debt (Wikipedia)](https://en.wikipedia.org/wiki/Technical_debt)

## From the book

Beside it in the book:

> … Divide roughly and you get more than eighty dollars per line, every year, for as long as the program exists. In return, in each of the three most recent versions of the program at the time, exactly one error had been found, and across eleven versions there had been seventeen, whereas a commercial program of comparable complexity, by an estimate in the same article, would have had about five thousand. Between eighty dollars a line and a dollar for a million lines lies a difference of almost a hundred million times, and this chapter is about what happens to the world when the cost of something falls that far.

- Read the chapter: [Chapter 3. A Million Lines for a Dollar](https://www.mikefluff.com/en/read/nobody-writes-code/ch03) (opening free, rest in the full book; Markdown: https://www.mikefluff.com/en/read/nobody-writes-code/ch03.md)

- Book: [Nobody Writes Code Anymore](https://www.mikefluff.com/en/books/nobody-writes-code) — $15
