Margaret Hamilton, the American programmer who led the team that wrote the onboard code for NASA’s Apollo spacecraft, has died at 90. The Massachusetts Institute of Technology (MIT), which built the software under contract to NASA, announced her death on October 7.
Hamilton got into programming before it was really a profession. At MIT, she started out on software for detecting aircraft. In 1965, she moved to the university’s Instrumentation Laboratory, which NASA had hired to build Apollo’s guidance and control system. The spacecraft already had engines, radar, gyroscopes, and a computer, but software wasn’t yet seen as an engineering system in its own right.
She first wrote code for Apollo’s uncrewed missions, then took charge of the group building software for the command and lunar modules on crewed flights. By 1968, she was responsible for the command and service module’s software, and hundreds of people were working on Apollo’s onboard code. Between 1969 and 1972, Hamilton worked on six missions that put astronauts on the Moon. Not a single error was recorded in her software during that time.
Her biggest contribution is considered to be the architecture that governed how the system behaved when something went wrong. The Apollo Guidance Computer had tiny computing resources by today’s standards, so the software had to decide strictly which tasks to run right away, which to postpone, and which to drop. Hamilton’s team used priority scheduling to do this. When the computer was overloaded, it shed secondary operations but kept running critical guidance tasks.
Follow Mediasat on Google News: the latest in TV, telecom and tech
That approach saved the Apollo 11 landing. Minutes before touchdown, the lunar module’s computer began throwing 1202 alarms. The radar was feeding it data that wasn’t needed to fly the landing but was eating up computing power. Instead of stalling, the software reshuffled its priorities and kept guiding the descent. Mission Control let the landing continue, and shortly afterward Neil Armstrong set the Eagle module down on the Moon.
Another well-known episode from her career is called “Lauren’s bug.” Hamilton often brought her four-year-old daughter Lauren to the lab. One day, the girl accidentally launched the P01 program on the simulator at the wrong moment, and the simulated flight crashed, wiping out data. Hamilton proposed changing the software so a human error like that couldn’t derail a real flight, but she was turned down: well-trained astronauts, the thinking went, would never make that mistake. Then, during Apollo 8, crew member Jim Lovell accidentally triggered the same P01 program. After that, Hamilton’s changes went into the onboard code.
Her work is credited with giving rise to the term “software engineering” and the idea of software development as a distinct engineering discipline. In 2016, then-President Barack Obama awarded Hamilton the Presidential Medal of Freedom, one of the highest civilian honors in the United States.


