Hamilton began her programming career at MIT under the mentorship of a renowned meteorologist, writing software to detect enemy aircraft. When the institute won a NASA contract to develop the Apollo onboard flight software, she joined as the first programmer and the first woman on the team.
"I was attracted both by the sheer idea and the fact that it had never been done before. I was the first programmer to join and the first woman they hired," Hamilton told the Guardian in 2019.
Her work proved critical during the Apollo 11 landing in 1969. Minutes before the spacecraft was to touch down on the lunar surface, an onboard computer alarm sounded, signaling an emergency. The spacecraft continued its descent because, as Hamilton explained, "it quickly became clear the software was not only informing everyone that there was a hardware-related problem but was compensating for it — restarting and re-establishing the highest priority tasks. The error detection and recovery mechanisms had come to the rescue."
Former President Barack Obama noted the incident when he presented Hamilton with the Presidential Medal of Freedom in 2016. "Our astronauts didn't have much time, but thankfully they had Margaret Hamilton," Obama said.
Reflecting on the mission in a 2009 interview with MIT News, Hamilton said: "Looking back, we were the luckiest people in the world; there was no choice but to be pioneers; no time to be beginners."
Hamilton is survived by her daughter, a son-in-law, two grandsons and four great grandchildren, according to MIT.