Skip to main content

Margaret Hamilton: The Woman Behind the 145,000 Lines of Code That Guided Apollo 11 to the Moon

Retracing the journey of Margaret Hamilton, who coined the term Software Engineer and wrote the life-saving software that rescued the Apollo 11 mission from disaster

AI-written
Inewgen
25 Jul 20264 min read (0 views)Last updated 31 Jul 2026
Share
Margaret Hamilton: The Woman Behind the 145,000 Lines of Code That Guided Apollo 11 to the Moon

Stock photo for illustration only, not from the actual event

Font size
  • Margaret Hamilton independently conceived and coined the term Software Engineer.
  • She built a bug database wall out of Polaroid photos to systematically study errors.
  • An incident where her 4-year-old daughter accidentally triggered a computer program error became a vital lesson for preventing system failures in Apollo 8.
  • Her priority-scheduling software system saved the Apollo 11 mission from the 1202 and 1201 alarm codes.

When people talk about the Apollo 11 mission, the names Neil Armstrong and Buzz Aldrin are usually the first to come to mind. However, on the night of July 20, 1969, inside the monitoring room of the MIT lab, a 32-year-old woman named Margaret Hamilton sat watching the computer screens throughout the night—at a time when her job title did not even officially exist yet, forcing her to coin the term Software Engineer herself.

Hamilton's life path began with studying mathematics and philosophy at Earlham College, followed by moving to Boston with her husband in 1958. She initially intended to find a temporary job to earn money to support her husband while he studied law at Harvard, before pursuing her master's degree in mathematics. Unexpectedly, that temporary job turned out to be a computer programming position at MIT, even though she had never seen a computer in her life.

In 1959, she began working with Edward Lorenz, a meteorologist who pioneered Chaos Theory, where she had to key weather forecasting data into an 800-pound LGP-30 computer and learn how to debug binary code manually using pencils and adhesive tape to splice paper tape. Later in 1961, she moved to the MIT Lincoln Lab to work on the SAGE project, a warehouse-sized military computer system designed to detect enemy aircraft.

Having to teach herself programming in an era without manuals or even computer science academic majors shaped Hamilton's perspective on errors differently from mainstream programmers of that time. Instead of viewing bugs merely as accidents that needed quick, ad-hoc fixes, she chose to understand the root causes of problems to prevent them from recurring—a concept that became a foundational cornerstone of modern software engineering.

Never miss the latest news?

Subscribe to get news summaries by email - not often enough to be annoying.

โฆษณา

Hamilton had a unique approach to troubleshooting errors: she required any programmer who caused a system crash to take a Polaroid photo of themselves next to the code printout of the error, and then pin them up on the room's wall to create a bug database wall. This allowed them to search for patterns and the actual causes behind system failures. This mindset led to her being recruited by Charles Stark Draper's MIT Instrumentation Lab in 1964 to lead the writing of navigation software for the Apollo spacecraft.

Her first assignment was writing code for the abort sequence, which she nicknamed "Forget It." However, when an emergency occurred during a test flight, this code executed with pinpoint accuracy and successfully saved the mission. This achievement led to her promotion as head of the Software Engineering Division, managing a team of nearly 100 software developers responsible for Man-Rated standards where astronauts' lives were on the line.

"The astronauts undergo rigorous training; there is no way they would ever make a silly mistake like a four-year-old child."

An Apollo project executive

The attitude of executives who had previously dismissed her approach to anticipating errors changed dramatically when she brought her four-year-old daughter, Lauren, to the lab. The little girl accidentally pressed the P01 program button on the flight simulator, wiping out all the navigation data. This incident, known as the Lauren Bug, actually reoccurred with astronaut Jim Lovell during the Apollo 8 mission, prompting management to immediately approve adding error-prevention code to the system.

Apollo 11 lunar module landing mission control

Comments

Leave a Comment
0/2000

Found something wrong in this article? Report an issue with this article