Zum Inhalt springen

The First Bug: A Moth in Relay 70

Zusammenfassung

On September 9, 1947, engineers testing the Harvard Mark II at the Naval Weapons Station in Dahlgren, Virginia, found a moth jammed in relay 70, Panel F, causing a malfunction. The insect was taped into the logbook with the annotation: “First actual case of bug being found.” The word “bug” for a technical defect had been in engineering use for decades — the moth was not the origin, but a literal, accidental illustration of a metaphor already embedded in the vocabulary of anyone who worked with machines.

The Mark II and the Moth

The Harvard Mark II was an electromechanical calculator — not electronic, but mechanical. Its computational elements were relays: electromagnetic switches that close or open a physical metal contact when current flows through a coil. Each relay was roughly the size of a matchbox. The Mark II contained thousands of them, clicking and switching hundreds of times per second during a calculation run.

On the afternoon of September 9, 1947, an error appeared during a test. Troubleshooting located the cause: a moth had flown into the relay bay and become wedged between the contacts of relay 70, preventing it from closing. The moth was removed with tweezers. Lieutenant Grace Hopper’s team taped it into the maintenance logbook with the entry:

1545. Relay #70 Panel F (moth) in relay. First actual case of bug being found.

The logbook page, moth intact, is preserved at the Smithsonian’s National Museum of American History.

The Word “Bug” Predated the Moth by Decades

The phrase “bug in the system” was engineering slang long before 1947. Thomas Edison used it in an 1878 letter describing the iterative process of developing a new invention:

It has been just so in all of my inventions. The first step is an intuition… then difficulties arise — this thing gives out and then that — ‘Bugs’ as such little faults and difficulties are called — show themselves.

Telephone engineers in the early 20th century used “bug” for intermittent faults — behavior that appeared and disappeared without obvious cause, like an insect that could crawl in and out of a mechanism. By 1947, the term was embedded in the vocabulary of anyone working with electrical machines.

Hopper’s team almost certainly wrote “First actual case of bug being found” as a joke — a deliberate play on the existing slang, made funny by the coincidence that they had found an actual insect. They were not claiming to have coined the word; they were performing a pun.

Grace Hopper and the Mark II

Grace Hopper was a naval officer and mathematician who joined the Harvard computation project in 1944, initially programming the Mark I. She became one of the most capable programmers of the early computing era — later designing FLOW-MATIC (the first English-language data processing compiler) and leading the CODASYL committee that produced COBOL. The Mark II project was one step in a career that spanned the entire first generation of computing.

The Mark II itself was already slightly behind the technological frontier when the moth was found: the ENIAC, a fully electronic machine with no moving parts in its computational elements, had been operational since 1945. Vacuum tubes failed frequently, but they could not be jammed by insects. The moth incident illustrates the specific vulnerability of electromechanical computing that electronic computing solved — though it introduced its own reliability problems in the process.

Why the Story Endures

The taped moth became one of the most frequently reproduced artifacts in computing history. Hopper told the story throughout her career, and it became a fixture of introductory programming courses. The reason is narrative efficiency: a physical insect causing a literal malfunction in a machine is more vivid than the correct etymology — a metaphor borrowed from 19th-century engineering vernacular. The story is also humanizing. The early computing pioneers were solving problems of extraordinary difficulty with unreliable hardware, and they were funny about it. Writing “First actual case of bug being found” in an official maintenance log required a particular kind of professional wit.


📚 Sources