← Back to Journal

leptons1618@anishgiri.dev:~/journal/the-punch-card-from-1928-that-still-formats-your-code less post.md

#COMPUTING_HISTORY#DEVELOPER_TOOLING#CODE_STYLE#TERMINALS#PUNCH_CARDS

The punch card from 1928 that still formats your code

Your linter's 80-character limit is the width of an IBM punched card from 1928 — and the 24 rows beside it come from something else entirely. A short history of a number that outlived all three of its reasons.

Your linter has an opinion about this line:

result = compute_everything(first_argument, second_argument, third_argument, x)

It is 79 characters. One more and something in your toolchain starts complaining.

Nobody in the room chose that number. It arrived in 1928, on a piece of cardboard, and it has outlived every piece of hardware that ever had a reason for it.

The card

In 1928, IBM standardised a punched card: rectangular holes, 80 columns, twelve punch positions in each. One column held one character. That format stayed the standard for roughly the next fifty years and became one of the most profitable products the company ever had.

So a line of code was 80 characters because a line of code was a card. Not a metaphor — physically one card, in a tray, in order, and if you dropped the tray your program was gone.

That is the whole origin. There is no mathematics in it. Eighty is how many little rectangles fit across a piece of card that had to be thick enough not to jam and small enough to hold in one hand.

The terminals inherited it

When glass terminals replaced card punches, they had to be able to replace them — same data, same forms, same width. Eighty columns was the compatibility requirement, and once a few terminals had it, every terminal had it. The DEC VT100 shipped in 1978 at 80×24 and became the thing everything else imitated.

Here is the part I like. The 80 came from cards. The 24 did not.

Early terminals stored the visible screen in delay-line memory — a physical loop, data circulating as a wave, the capacity set by how long the loop took. You got the number of rows the hardware gave you. The 24 in 80×24 is a fossil of a completely different constraint from the 80 beside it, and the two have been sitting next to each other ever since, looking like a matched pair. (Ken Shirriff has the long version, and it is worth the detour.)

The same era gave us ls, mv, cp, rm. The usual explanation is that terminals ran at 110 baud — ten characters a second — and every letter you did not type was a letter you did not wait for. Whether or not that is the whole story, it is a good reminder that terse Unix naming was not a design philosophy. It was typing on a machine that typed back slowly.

So we argue about it every few years

May 2020: the Linux kernel stopped treating 80 columns as the hard limit. checkpatch.pl went to 100. The commit was careful to say 80 is still preferred — 100 is there to catch “what are you doing” lines rather than lines that are slightly long. Linus’s objection was that code mangled into compliance is worse than code that runs four characters over.

Meanwhile PEP 8 still says 79. Black picked 88, which is 80 plus ten percent, arrived at deliberately rather than inherited.

Every one of those numbers is a descendant of the card. None of them is about the card.

The bit that is actually interesting

The easy conclusion is that 80 is a fossil and we should get over it. I do not think that is right, and the reason is the thing worth taking away.

Somewhere along the way the constraint stopped being about hardware and started being about eyes. Long lines are genuinely harder to read — typography worked this out for print centuries before anyone had a terminal, and lands in roughly the same place for roughly the same reason. Newspapers run narrow columns on purpose. Your eye loses its place on a long line and has to hunt for the start of the next one.

So we have a number that is right for a reason that has nothing to do with why we have it. It was a card width; it survived as a compatibility requirement; it persists as a readability heuristic. Three completely different justifications, one number, and the number never moved.

That is a specific kind of trap, and it is not really about line length. When you defend a convention, it is worth knowing which of its reasons you are defending — because the original one is usually dead, and the good one is usually something nobody wrote down.

Keep your lines short. Just not because of the cardboard.