The First Computer Bug Was an Actual Bug
In 1947, a team debugging the Harvard Mark II found the problem: a moth, jammed in a relay.
Photo: U.S. Naval History and Heritage Command, 1947 — public domain
On September 9, 1947, operators working on the Harvard Mark II — a room-sized electromechanical computer built from thousands of relays — went looking for the cause of a malfunction. They found a moth wedged inside one of the relays, physically blocking it from switching.
They taped the moth into the machine's logbook with a note: "First actual case of bug being found." The word "bug" for a technical fault already existed in engineering slang going back decades — Thomas Edison used it in letters in the 1870s — but this is the moment the term got attached, quite literally, to computing, and the logbook page survives today in the Smithsonian's collection.
The Mark II was a faster machine than its famous predecessor, the Mark I: its high-speed relays made addition about 2.6 times faster and multiplication about eight times faster. It was still at Harvard that September; the Navy took delivery of it at the Dahlgren Proving Ground in Virginia in March 1948.
The Mark II was built under the direction of Howard Aiken, and Grace Hopper was part of his team. She wasn't the one who found the moth, and she didn't coin "bug" either, though she's often credited with both. What she did was tell the story so often, and so well, that it became computing folklore. Her real contribution was bigger, though. By 1952 she had finished the A-0, an early program she called a compiler; by modern standards it was closer to a linker and loader, and she recalled that nobody believed it could be done, since colleagues insisted computers could only do arithmetic. From 1954 her department released some of the first compiler-based programming languages, including FLOW-MATIC, and she championed the idea — controversial at the time — that people should write programs in something closer to English rather than raw machine code.
That idea fed into COBOL. At a two-day conference in spring 1959, experts from industry and government met to design a common business language, with Hopper as a technical consultant, and COBOL extended her FLOW-MATIC with ideas from IBM's COMTRAN. It became one of the most widely used programming languages in business computing history.
Hopper was also a teacher with props. To show what a nanosecond means, she handed out lengths of wire 11.8 inches long, the distance light travels in one billionth of a second. She retired from the Navy in 1986 at 79, as a rear admiral.
The moth, not the metaphor, is what made it into a museum.
Sources
- Grace Hopper — Wikipedia