Cubic Pixel
GET IN TOUCH
PRODUCTS WORK PLAYGROUND BLOG ABOUT GET IN TOUCH
HOME / BLOG / ARTICLE

The Moth in the Machine

APRIL 28, 2024·8 MIN READ
The Moth in the Machine

There is a yellowed page from a 1947 engineering logbook, currently sitting in a climate-controlled drawer at the Smithsonian’s National Museum of American History in Washington, that has a moth taped to it.

Above the moth, in neat blue handwriting, someone has written: Relay #70 Panel F (moth) in relay. First actual case of bug being found.

It is, by some distance, the most famous piece of paper in the history of computing. It has been reproduced in textbooks, hung in offices, photographed for documentaries, and cited as the origin of the word bug by roughly every introduction-to-programming course ever taught. The story it tells is short, vivid, and impossibly satisfying: in 1947, the great Grace Hopper found an actual insect inside an actual computer, taped it into the logbook, and gave us the word we now use for every software defect ever shipped.

The story is wonderful. It is also, in almost every detail that matters, slightly wrong.

The scene, as it actually happened

On the afternoon of September 9, 1947, Harvard’s Mark II Aiken Relay computer was malfunctioning. The Mark II was not a computer in any sense a modern person would recognise. It was a vast electromechanical beast — a room-sized arrangement of relays, switches, and wiring, the kind of machine where every calculation involved physical components clacking open and closed thousands of times a second. It made noise. It generated heat. It had moving parts. And, crucially for our story, it had small gaps inside it that a determined insect could fit through.

A team of engineers, working through the failure, eventually traced the problem to Relay #70, Panel F. When they opened it, they found a moth wedged between the contacts. It had been killed by the relay closing on it. It had also, in dying, prevented the relay from closing properly, which was why the machine was misbehaving.

A computer, in 1947, could be brought down by a single confused moth. There is something almost touching about that.

The engineers extracted the moth, taped it into the logbook with cellulose tape, and added the now-famous note. The exact time was recorded: 15:45. Quarter to four in the afternoon. The kind of detail that makes a story feel like history rather than legend.

That part is all true.

The parts that aren’t

The first inconvenient detail: the logbook was probably not Grace Hopper’s. The Smithsonian, which has the artefact, says so directly in its own catalogue entry. The handwriting does not match hers. Hopper was on the Mark II team — she was, by 1947, already one of the most important programmers alive — but she does not appear to have been the person who taped the moth into the page or wrote the caption.

The second inconvenient detail: she probably did not find the moth either. According to careful historical work on the incident, the actual discovery is credited to engineer William B. Burke and colleagues, testing Aiken’s Harvard Mark II Relay Calculator. Burke is not a household name. He is barely a footnote. But he, or someone working alongside him, is the person who actually pulled the moth out of Relay #70.

Hopper’s role in the story is real but more diffuse. She was on the team. She was almost certainly in the room or nearby when it happened. And, crucially, she retold the story for the rest of her life — which is how it became her story in the public imagination, in the same way that a great anecdote eventually belongs to whoever tells it best at parties.

The third inconvenient detail, and the one that quietly undermines the whole legend: the engineers in 1947 did not invent the word bug. They were making a joke about a word that already existed.

Edison got there first

Look closely at the logbook caption. It does not say first case of a bug being found. It says first actual case of bug being found.

That word — actual — is doing all the work. It is the punchline. The joke is that engineers had been calling small mechanical defects bugs for decades, and now, finally, one of them had found a literal one. The whole point of the entry is that the term was already in use. Otherwise the comment makes no sense.

The trail runs back to Thomas Edison, who in a letter written in 1878 referred to “‘Bugs’ as such little faults and difficulties are called”. That phrasing — as such little faults are called — is the giveaway. Edison was using a term that was already common engineering slang in his world. By the time the Pall Mall Gazette quoted him on the subject in 1889, the word was familiar enough that newspaper readers were expected to understand it without explanation.

So by 1947, when the Harvard team taped a moth into a logbook and called it the first actual case of a bug being found, they were riffing on roughly seventy years of pre-existing usage. The joke is good precisely because the meaning was already established. The humour comes from the literalness — the gap between the metaphor everyone knew and the small dead insect that had, against all odds, made the metaphor true.

It is, in other words, a sight gag. One of the earliest sight gags in the history of computing. And like most good jokes, it has been ruined by being repeatedly explained as something more profound than it was.

Why the myth survived

If the entire foundation of the story is wrong — wrong protagonist, wrong attribution, wrong etymology — why has it lasted?

The honest answer is that the story is better than the truth. It is short. It has a hero. It has a satisfying ironic twist. It has a physical artefact you can go and look at in a museum. It collapses the entire complicated history of a word into a single charming scene with a moth in it. The real version — engineers had been using the term for seventy years, a man named Burke probably found the insect, the famous person you have heard of mostly told the story afterwards — is more accurate but profoundly less shareable.

There is a useful principle in the philosophy of folklore: the best stories tend to win, regardless of their relationship to the facts. Once a narrative becomes good enough to repeat, it acquires its own gravity. People tell it, other people remember it, it gets reprinted, and after enough cycles the original record is no match for the legend. Even when the National Museum of American History — which physically owns the logbook — gently corrects the attribution in its own catalogue, the corrected version simply does not travel. The mythical version travels. The mythical version always travels.

This is, incidentally, why so many origin stories in technology are slightly off. The Apple in the garage. The Facebook dorm room. The napkin sketch. The eureka shower. None of them are entirely wrong. They are just smoother than what actually happened, and the smoothness is what makes them survive.

What the moth is actually for

I think the moth is doing something more interesting than just being a charming origin story. It is doing something almost ceremonial.

Software is, by its nature, invisible. You cannot hold a function in your hand. You cannot point to a memory leak. The entire field is conducted in symbols, and the failures of the field are conducted in symbols too. A bug, in the modern sense, is a thing that does not exist anywhere physical — it is a flaw in a pattern of electrical states that, for a brief moment, made a system behave in a way nobody intended.

The 1947 moth is, by accident, the only physical bug in the entire history of the discipline. Every other software defect ever found has been intangible. This one was a moth. You can look at it. You can see its wings. You can see the tape that some unnamed engineer used to fix it to the page seventy-eight years ago, presumably while laughing at the joke.

That is why the artefact endures, even when the story around it does not survive scrutiny. It is the closest the field has ever come to having a relic. A piece of physical evidence from a profession that almost never produces any.

The pilgrimage

The logbook is not always on public display at the Smithsonian — it lives in the museum’s collection and surfaces periodically — but when it is out, people queue up to see it. They lean close to the glass. They take photographs through the case. They explain the story, mostly inaccurately, to whoever they have come with.

Almost none of them are looking at the right thing. They are looking at the moth, when the more interesting object on the page is the word actual. Three syllables of dry engineering humour from a Tuesday afternoon in 1947, scribbled in passing, accidentally outliving everyone in the room.

The moth was a moth. It got into a relay. It died there. The machine stopped working. Someone fixed it, made a small joke about a term they all already knew, and got back to work.

That is the whole story. It just happens to be one of the few moments in computing history where the receipt survived.

Hello, world, indeed.

Ghassan
WRITTEN BY
Ghassan

Builder behind Cubic Pixel. I spend my days on large digital platforms and my nights making things of my own — apps, tools, music, experiments. I write about digital systems, product craft, and the stories behind the technology we take for granted, mostly as a way of understanding it properly myself

ABOUT ME

Comments

NO COMMENTS YET
Be kind — comments are moderated.
Thanks — your comment is awaiting moderation.
No comments yet.

Be the first to share your thoughts — I read and reply to every comment.

← PREVIOUS Hello, World
← BACK TO THE BLOG