Margaret Hamilton in 1969, when she was the lead software engineer of the Apollo Project. She is standing next to a huge stack of code she and her MIT team produced for the Apollo project.

Margaret Hamilton, the first software engineer [her code put humans on the moon!]

Margaret Hamilton is not only one of the first software developers, but she also coined the term ‘Software Engineering’ to describe her work. The code she wrote successfully put humans on the moon for the first time.

The First Software Engineer: Margaret Hamilton

Margaret Hamilton was born on August 17, 1936, in Paoli, Indiana, United States. In school, her favorite subject was mathematics, as she enjoyed deriving answers rather than memorizing them.

She studied mathematics at the University of Michigan and received her undergraduate degree in 1958. Shortly after that, she married.

To support her husband, who was pursuing a law degree at Harvard, Hamilton put her graduate studies on hold and briefly taught high school mathematics and French. She then got a job as a programmer at MIT (Massachusetts Institute of Technology), where she developed software for predicting the weather and detecting enemy planes.

This work made her a strong candidate for a job opening at NASA, which her husband had spotted in a newspaper.

NASA: “We are looking for people to do programming to send men to the moon”

Hamilton recalls: “They [NASA] announced that they were looking for people to do programming to send men to the moon.”

By 1965, at the age of 28, Hamilton joined the Charles Stark Draper Laboratory at MIT, which was working on the Apollo space mission. She became the first programmer NASA hired.

Eventually, she would lead the team developing the onboard flight software, which included algorithms designed by various senior scientists for the Apollo command module, the lunar lander, and the subsequent Skylab, the only space station the U.S. has operated exclusively.

Margaret Hamilton in 1969, when she was the lead software engineer of the Apollo Project. She is standing next to a huge stack of code she and her MIT team produced for the Apollo project.
Margaret Hamilton in 1969, when she was the lead software engineer of the Apollo Project. She is standing next to a huge stack of code she and her MIT team produced for the Apollo project. This is perhaps her most famous photo. Image source: Intel

It Was Like the “Wild West”

It was ten years before Microsoft. The field of computing was still very new. Computers were huge, often taking up entire rooms, if not an entire warehouse, and the work of programming was still developing.

Hamilton recalls, “When I first got into it, nobody knew what it was that we were doing. It was like the Wild West. There was no course in it. They didn’t teach it.”

According to Wired, the Apollo mission didn’t even mention the word software, MIT aeronautics professor David Mindell writes in his book Digital Apollo. “Software was not included in the schedule, and it was not included in the budget.”

However, the importance of software became clear as the Apollo project progressed.

Hamilton’s job was not easy. The responsibility was immense, and sometimes the pressure kept her up at night. Once, after a late-night party, she rushed back to the computer lab to correct a piece of code she’d suddenly realized was flawed. “I was always imagining headlines in the newspapers, and they would point back to how it happened, and it would point back to me.”

Astronauts Never Make Mistakes – They Were Trained to be “Perfect”

Margaret Hamilton says, “Mostly men were working there. They had somebody at home to take care of their kids. I had no choice.”

So she brought her daughter Lauren into work. Lauren would see her mother playing astronaut to test the software and doing the kinds of things the astronauts would do.

Hamilton’s daughter wanted to join in, playing astronaut – and she did.

Then, one day, everything suddenly crashed on the simulator. After investigating the cause, Hamilton realized that her daughter had selected the pre-launch program called P01 during the flight.

Hamilton recalls, “I said, oh my god, this is not good. We really need to put protection in there because the astronaut really could do what she did by mistake.”

But NASA said “no.” They insisted, “Astronauts never make mistakes – they are trained to be ‘perfect.’”

However, as every software developer knows, “whatever can go wrong, will go wrong.” Around Christmas 1968, five days into the historic Apollo 8 flight (the first crewed spacecraft to leave low Earth orbit, reach the Moon, orbit it, and safely return), astronaut Jim Lovell inadvertently selected P01 during flight.

Luckily, Hamilton won the debate eventually. She programmed error-checking codes that allowed the Apollo 8 flight to successfully return to Earth, even when astronaut Jim Lovell aboard inadvertently deleted all the navigation data the onboard computer had been collecting.

Apollo 8 Guidance Computer Incident

According to Wired and many other websites, Margaret Hamilton added a note saying, “Do not select P01 during flight.” Then, during the Apollo 8 flight, astronaut Jim Lovell (who later commanded Apollo 13 and famously said, “Houston, we’ve had a problem,”) inadvertently selected P01. After spending nine hours, Hamilton and the MIT coders came up with a fix, uploaded new navigational data, and saved the mission (and the lives of the astronauts aboard).

However, I couldn’t verify that story. Wikipedia’s Apollo 8 entry, which cites Richard W. Orloff, for example, tells a different version:

“Lovell accidentally erased some of the computer’s memory, which caused the inertial measurement unit (IMU) to contain data indicating that the module was in the same relative orientation it had been in before lift-off; the IMU then fired the thrusters to “correct” the module’s attitude.”

“Once the crew realized why the computer had changed the module’s attitude, they realized that they would have to reenter data to tell the computer the module’s actual orientation. It took Lovell ten minutes to figure out the right numbers, using the thrusters to get the stars Rigel and Sirius aligned, and another 15 minutes to enter the corrected data into the computer. Sixteen months later, during the Apollo 13 mission, Lovell would have to perform a similar manual realignment under more critical conditions after the module’s IMU had to be turned off to conserve energy.”

Orloff is the author of books titled “Apollo By The Numbers” and “Apollo: The Definitive Sourcebook.

Margaret Hamilton is testing the software she wrote during her time as lead Apollo flight software designer
Margaret Hamilton is testing the software she wrote during her time as lead Apollo flight software designer. Image: Wikipedia

The Code of Margaret Hamilton Eventually Got Humans to the Moon

On July 16, 1969, NASA launched Apollo 11, the first crewed mission to the moon. Three minutes before landing, a crewmember set a switch in the wrong position, causing the software to overload with interrupts due to incorrectly phased power supplied to the lander’s rendezvous radar.

The program alarms indicated “executive overflows,” meaning the guidance computer could not complete all of its tasks in real time and had to postpone some of them.

Margaret Hamilton recalls, “There was an emergency – giving the astronauts a go/no go decision (to land or not to land).”

Jack Garman, a NASA computer engineer in mission control, recognized the meaning of the errors presented to the astronauts by the priority displays and shouted, “Go, go!”

On Sunday, July 20, at 20:17:40 UTC, the Lunar Module named “Eagle” landed on the moon.

Neil Armstrong announced the landing with the words, “Houston, Tranquility Base here. The Eagle has landed.”

Moon Landing: Apollo 11 astronaut Buzz Aldrin on the Moon.
Margaret Hamilton’s code got humans on the Moon: Astronaut Buzz Aldrin, the lunar module pilot, stands on the surface of the moon near the leg of the lunar module, Eagle, during the Apollo 11 moonwalk. This image was cataloged by NASA Headquarters of the United States National Aeronautics and Space Administration (NASA) under Photo ID: AS11-40-5903. Image: Wikipedia

Margaret Hamilton Invented the Term “Software Engineering”

In a recent interview with the Spanish newspaper El País, she explained why she chose this term to describe her job:

“During the first days of the Apollo Project, the software was treated as an adopted child and was not taken as seriously as other engineering disciplines, such as hardware engineering. It was thought of as art and magic, not science. Knowing this, I fought to bring the software legitimacy so that it -and those building it- would be given its due respect. 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.”

“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.”

NASA soon realized that Hamilton’s “software engineering” would be the tool they needed to beat the Soviet Union in the race to the Moon.

The Presidential Medal of Freedom

Margaret Hamilton and President Barck Obama. In 2016, Hamilton received the highest civilian honor in the United States: The Presidential Medal of Freedom.
In 2016, Margaret Hamilton received the highest civilian honor in the United States: The Presidential Medal of Freedom.

In 2016, Margaret Hamilton received the highest civilian honor in the United States: The Presidential Medal of Freedom, for her work on the Apollo program and the creation of the Universal Systems Language (USL, a modeling language and formal method for the specification and design of software and other complex systems).

Sources

M. Özgür Nevres

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.