10/07/2026 | Press release | Distributed by Public on 10/07/2026 15:43
"Defensive" programming and priority-driven software take humans to the moon
Hamilton discovered a talent for leadership, as well as a keen instinct for problem-solving and critical thinking that would prove to save Project Apollo several times over.
There was the incident that became known as "the Lauren error": One day, her daughter Lauren, then four years old, was playing with the command module simulator at the Instrumentation Lab when she somehow activated a pre-launch program, called P01, while the simulator was in midflight - which crashed the simulator altogether. Hamilton created a program add-on in the technical documentation warning users not to launch P01 during flight.
She also proposed a software fix to prevent the error happening during a real mission, but she was overruled on the grounds that the highly trained astronauts were never going to make that same mistake. Yet during the Apollo 8 mission in 1968, that's exactly what happened: Jim Lovell inadvertently launched P01 during the flight, causing the on-flight navigational data to vanish. Hamilton and her team were called in to solve the error, and after that her proposed changes were integrated into the program. This was an early example of "defensive" programming, the practice of building software that could anticipate or fix errors on its own.
Hamilton's most famous contribution to the Apollo program came during the pivotal Apollo 11 mission to land on the moon in July of 1969. Moments before the Eagle module was set to land on the lunar surface, the onboard computer raised the alarm. It had detected a 1202 error: The computer was overloaded due to a fault in a hardware switch, and it was possible the system would not be able to handle the complex landing procedure.
But Hamilton and her team had engineered priority-driven software, able to shut down unnecessary background tasks in order to prioritize mission-critical tasks. Houston trusted Hamilton's software and allowed the mission to proceed, and two men walked on the moon for the first time.
Later career and legacy
Hamilton continued to work at the Instrumentation Lab into the 1970s. As the Apollo program wound down, the Instrumentation Lab spun out of MIT to become the independent Draper Laboratory.
"Margaret left an indelible mark on Draper, and we will be forever grateful," says Jerry M. Wohletz SM '97, PhD '00, president and CEO at Draper. "Through her leadership and contributions to the development of the onboard flight software for NASA's Apollo Guidance Computer, she helped ensure that Apollo astronauts landed safely on the lunar surface and safely returned home. We will honor her legacy at Draper forever."
Hamilton went on to create her first software company, Higher Order Software, in 1976. The firm was based on Hamilton's software engineering approach of error prevention and fault tolerance.
A decade later, Hamilton founded another software company, Hamilton Technologies, "to provide products and services to modernize the planning, system engineering and software development process in order to maximize reliability, lower cost and accelerate time to market."
Hamilton Technologies' flagship product is the Universal Systems Language (USL), a systems modeling language and methodology for engineering complex software systems that prioritize error prevention and defensive programming.
Throughout her career, Hamilton worked to achieve recognition for software engineering as a dedicated discipline.
"I fought to bring the software legitimacy so that it - and those building it - would be given its due respect, and thus I began to use the term 'software engineering' to distinguish it from hardware and other kinds of engineering, yet treat each type of engineering as part of the overall systems engineering process," Hamilton told El Pais in 2018. "When I first started using this phrase, it was considered to be quite amusing. It was an ongoing joke for a long time. They liked to kid me about my radical ideas. Software eventually and necessarily gained the same respect as any other discipline."
Among her many awards and honors, Hamilton was recognized with the NASA Exceptional Space Act Award for scientific and technical contributions in 2003; the Computer History Museum Fellow Award in 2017; the Intrepid Lifetime Achievement Award in 2019; and induction into the National Aviation Hall of Fame in 2022.
Later in life, Hamilton become an icon for women in science and technology, especially after a now-famous photo, showing her next to a printout of her MIT team's Apollo code, began circulating online. In 2015, the Apollo software she helped to develop was added in its entirety to the code-sharing site GitHub. And in 2017, she became an official Lego Minifigure after a set originally designed by MIT science communicator Maia Weinstock, honoring her and several other women of NASA history, became available worldwide.
"Margaret Hamilton has been an inspiration to generations of computer scientists and engineers. Hers was a career dedicated to preventing errors and what she called 'handling the unknown,'" says de Weck. "She personified leadership by example, and established a practice of software engineering based on problem-solving and systems engineering that we all benefit from."
Hamilton is survived by her daughter, Lauren Hamilton; her son-in-law, Richard Selesnick; two grandsons; and four great grandchildren. A memorial service will take place in the spring in Cambridge, Massachusetts.