Grace Hopper: The Navy Admiral Who Invented the Computer Compiler and Coined the Term Bug
In September 1947, a team working on the Harvard Mark II computer at a naval testing facility in Virginia tracked down a malfunction and found a moth lodged in one of the machine’s relay switches. They taped it into the logbook with a note: “First actual case of bug being found.” The moth is still in the logbook. The logbook is in the Smithsonian.
The person who coined the term debugging from that incident was Grace Hopper, a Navy officer who also happened to be one of the most important computer scientists of the 20th century. She invented the compiler. Helped develop COBOL, the programming language that still runs the majority of the world’s financial transactions today. She retired from the Navy at 79 as the oldest active-duty commissioned officer in the United States military.
Where She Started
Grace Brewster Murray was born in New York City in 1906 into a family that expected its daughters to be educated. Her father lost both legs to arteriosclerosis when she was young and lived by the principle that his daughters deserved the same opportunities as his sons. Hopper took apart seven alarm clocks at age seven to understand how they worked, which was either engineering curiosity or a personality trait depending on how you look at it. Probably both.
She earned a bachelor’s degree in mathematics and physics from Vassar College in 1928 and a PhD in mathematics from Yale in 1934, one of four women in a program of ten. She became an associate professor of mathematics at Vassar. When the United States entered World War II, she tried to join the Navy and was initially rejected: too old at 34, too light at 105 pounds, in a job deemed too essential to national defense for her to leave. She persisted. She was granted a leave of absence from Vassar, waived the weight requirement, and was commissioned as a lieutenant in the Navy WAVES in 1943.
Her request to transfer to the regular Navy at the end of the war was denied because of her age. She was 38. She called that rejection one of the most frustrating moments of her career.
The Mark I and What She Did There
Hopper’s first assignment was the Bureau of Ordnance’s Computation Project at Harvard University, working under Howard Aiken on the Mark I computer. The Mark I was 51 feet long and 8 feet tall, weighed about 10,000 pounds, and contained roughly 765,000 components connected by 500 miles of wire. It was the first large-scale automatic digital computer in the United States, and Hopper arrived to work on it with no background whatsoever in computing because computing as a field barely existed yet.
Aiken handed her a copy of a technical manual and told her to compute the coefficients of the arc tangent series by the following Monday. She did it. She stayed at Harvard until 1949, writing the first computer manual, a 500-page document that explained how to operate the Mark I and remains a foundational text of computer science.
The moth incident happened in 1947 during work on the Mark II. Hopper did not actually find the moth herself. Her team did. But she documented it, used the term debugging, and the language stuck. She later said she was sorry she had not claimed credit for the original discovery.
The Compiler and Why It Mattered
In 1949, Hopper joined the Eckert-Mauchly Computer Corporation in Philadelphia and began working on the UNIVAC I, the first commercial electronic computer. Here she did the work that should have made her a household name.
At the time, computers only understood machine code: binary instructions written in ones and zeros. Writing programs meant writing in machine language, which was painstaking, error-prone, and required specialized knowledge most people did not have. Hopper had a different idea. She believed computers could be instructed to translate English-language commands into machine code automatically. Her colleagues told her this was impossible. Computers could only do arithmetic, they said. They could not do that.
She built it anyway. In 1952, she completed the A-0 compiler, a program that translated mathematical notation into machine code. She named it a compiler because it compiled, or assembled, the instructions. The name, and the concept, have remained in computing ever since. Every piece of software you have ever used exists because someone could write it in a human-readable language and a compiler converted it into something a machine could run.
Hopper spent years trying to get her colleagues and superiors to take the compiler seriously. She later described the resistance: “I had a running compiler and nobody would touch it. They told me computers could only do arithmetic.” She worked around the resistance, ran demonstrations, showed results, and eventually the approach became standard.

COBOL and the Language That Would Not Die
By the late 1950s, different companies were using different programming languages for their computers, which meant programs written for one machine could not run on another. Hopper had been pushing for a common business language that could run across systems. In 1959, the Department of Defense convened a committee to create exactly that. Hopper served as technical consultant.
The result was COBOL, the Common Business-Oriented Language. It was designed to be readable in English rather than mathematical notation, so that business managers and administrators could understand the programs running their organizations. Hopper spent years advocating for its adoption, pushing back against organizations that resisted standardization.
By the 1970s, COBOL was the most extensively used programming language in the world. Today, decades later, COBOL still processes an estimated $3 trillion in commerce daily. The majority of the world’s financial transactions, bank accounts, insurance systems, and government benefits run on COBOL code. There are more lines of COBOL in active use than any other programming language. Every time you use an ATM or file a tax return, there is a reasonable probability that COBOL is involved.