Image for post
Image for post
Margaret Hamilton by @SebastianNavasF

Margaret Hamilton — Coding to the Moon

On July 20 of 1969, just as the Apollo 11 astronauts were about to land on the moon, something unexpected happened that stopped the heartbeats of the entire crew at Mission Control in Houston. The mission could have been aborted but thanks to Margaret Hamilton and her code to prevent user-errors, the landing was safe and three minutes later a human placed their feet on the moon for the first time in history.

Hamilton spent long hours at MIT’s Apollo project from NASA, leading the Software Engineering Division responsible for the unmanned missions on-board flight software. Often on nights and weekends, she took her daughter Lauren to work and she would see Margaret use the simulator’s display-and-keyboard unit (DSKY) to test the software. One day, wanting to play astronaut, Lauren crashed the simulator and Margaret realized it was because she had selected the pre-launch program PO1 during “flight”. She instantly started to worry about the debug session her daughter had adventured and asked herself “What if the astronaut did what she just did?”.

Image for post
Image for post
Apollo display-and-keyboard unit (DSKY)

Hamilton started telling to the people at MIT that maybe they should think of putting some change in the code if the astronauts accidentally choose PO1, but they told her that astronauts were well-trained never to make a mistake so they wouldn’t need that. “Everyone said, ‘That would never happen’”, she remembers. But this same thing happened with the preceeding flight Apollo 8, so management at NASA at last agreed to include a user-error check in the code for all future flights. Margaret even added a program note that said “Do not select PO1 during flight”.

Expect the Unexpected

That day the normal mission sequences were interrupted by priority displays of 1201 and 1202 alarms warning there was an emergency of “executive overflow”, giving the astronauts a go/no go decision (to land or not to land). What happened was that the Rendezvous Radar system switch had been manually set to the wrong position and because the computer did not have enough time to do the request it started overflowing and triggered the alarms.

Thanks to Hamilton’s ultra-reliable code, the Lunar Module’s computing system was simply dumping the low priority jobs and carrying on with the important ones. The code prevented to abort the mission, a go decision to land was sent from Earth and minutes later Neil Armstrong voiced: “Houston, Tranquillity Base here. The Eagle has landed”.

Colossus 2A

Image for post
Image for post
First page of the Colossus 2A — Margaret Hamilton Colossus Programming Leader

The assembly code for the Command Module’s (CM) Apollo Guidance Computer (AGC) that Margaret Hamilton and her team wrote is public and open. Up to present day, no bug has ever been found on any onboard flight software Apollo mission for Hamilton was extremely detailed; as she said, “There was no second chance”.

Software Engineering

Humans today are expected to be fully integrated to the software systems, but that wasn’t always the case. Hamilton definitely built the blocks for modern software engineering, a term she coined, while moving from “complete freedom to bureaucratic overkill”.

For instance, with roots on Apollo missions Margaret’s categorization of interference errors led to a system of control that set the foundations of the Universal Systems Language (USL) and Development Before the Fact (DBTF) paradigm. Traditionally, software design approach is more about fixing, testing for errors once it is already running, but Hamilton USL’s development-before-the-fact philosophy seeked to be preventive, virtually eliminating errors before they arrise.

Margaret has received many awards in recognition for her legacy, such as the Augusta Ada Lovelace Award and the Presidential Medal of Freedom, the highest civilian honour in the United States. However, arguably the coolest recognition she had was getting a LEGO figure on the Women of NASA set, characterized like the famous photo in which she stood next to her pile of code.

Image for post
Image for post
Women of NASA on LEGO Ideas — Margaret Hamilton and her code to the moon.

Advent Calendar — Help us make it a book!

From December 1st until December 24th we plan to release one article each day, highlighting the life of one of the many women that have made today’s computing industry as amazing as it is: From early compilers to computer games, from chip design to distributed systems, we will revisit the lives of these pioneers.

Each article will come with an amazing illustration by @SebastianNavasF.

If you want to see these series to become a book with expanded articles and even more illustrations by Sebastián, then subscribe to our newsletter below.

Credits

References

A Computer of One’s Own

Pioneers of the Computing Age

Medium is an open platform where 170 million readers come to find insightful and dynamic thinking. Here, expert and undiscovered voices alike dive into the heart of any topic and bring new ideas to the surface. Learn more

Follow the writers, publications, and topics that matter to you, and you’ll see them on your homepage and in your inbox. Explore

If you have a story to tell, knowledge to share, or a perspective to offer — welcome home. It’s easy and free to post your thinking on any topic. Write on Medium

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store