Skip To Content

How code landed humans on the moon

How code landed humans on the moon

It’s July 20th, 1969. You’re huddled around a small TV screen with your closest friends and family, along with 600 million other people around the world, watching Apollo 11 land the first humans on the moon. You watch as the tiny spacecraft makes its descent to the surface, and you applaud with complete joy a Neil Armstrong’s grainy voice says one of the most infamous quotes in history... “One small step for man, one giant leap for mankind”.

Would it surprise you if I told you that a woman named Margaret Hamilton played a pivotal role in the United States winning the race to the moon against the Soviet Union? What if I told you that just 3 minutes before Apollo 11 safely landed the first men on the moon, the onboard computer was spitting out alarming error messages? How about if I told you that Houston ignored those messages and proceeded with the landing because they trusted the software created by Margaret to perform properly? Talk about pressure.

Margaret Hamilton is a true inspiration to me, and I hope that you will feel the same way after hearing her story about how you should never be too afraid to shoot for the moon.

How Margaret wrote the code that landed humans on the moon.

At a time when gender roles ruled society, a woman was not supposed to lead a team in pioneering the software that would eventually land men on the moon. That never stopped Margaret from pursuing her dreams when she found an ad in the local newspaper from NASA who was searching for help to beat the Soviet Union to the moon.

At 28 years old, Margaret found herself leading a team of developers to create the onboard flight software for Apollo 11 that would be used to safely land the spacecraft on the moon.

“The space mission software had to be man-rated. Not only did it have to work, it had to work the first time. Not only did the software itself have to be ultra-reliable, it needed to be able to perform error detection and recovery in real time. Our languages dared us to make the most subtle of errors. We were on our own to come up with rules for building software. What we learned from the errors was full of surprises,” Hamilton said.

Below is the stack of code written by Margaret and her team in order to accomplish such a revolutionary task. All I have to say, is thank goodness I got into the field later than Margaret and all my code is digitized!

The time had finally come to put all of Margaret and her team’s hard work to the test. The astronauts on Apollo 11 were just three minutes away from making the first lunar landing when disaster struck. On board, the Apollo computer started spitting out error messages due to the computer making a slew of unnecessary calculations. Houston, they had a problem! But it was in this moment that the most amazing thing happened. Houston told Apollo 11 to continue with their mission. You see, Margaret wrote the software to prioritize landing on the moon and stop all other uncecessary processes if the computer were to become overloaded, and all of her hard work paid off. It was thanks to this innovative technology that the United States was able to land safely. This truly was one small step for Margaret, one giant leap for technology.


What can we learn from Margaret Hamilton?

Just because it hasn’t been done, doesn’t mean it can’t be done.
As a designer and developer, I find it easy to stick to what works. I’ve written thousands of lines of code. I know what code has worked, and what hasn’t. I know which layouts perform well, and which struggle. I can tell you what color would give your call to action a higher click through rate.

When Margaret started this project, the term “software engineer” didn’t even exist. There was very little respect in the community since people struggled to see how software and hardware could work together to revolutionize the world. In all reality, NASA would have been lost without the out-of-the box thinking from Margaret and her team.

Margaret is a constant reminder that if we stick to what we know, or what’s already been done, we’re not doing ourselves or the world of technology any justice. Because of innovators like her, I’m inspired to break the mold and take the road less travelled.

Test, test, and test some more.
Margaret’s code needed to be foolproof. They had only one chance to get it right, or the results would be catastrophic. It was actually Margaret's daughter, Lauren, who performed a fatal user error one day while playing Astronaut with the flight simulator. When Margaret brought up her concerns to NASA she was told that “Astronauts never make mistakes” — it should come as no surprise that Margaret won the battle and was able to refine her code to prevent the error for ever happening again. Don’t forget, it’s not always your target audience that are the best users to test.

Trust in your work
When you put your heart into something, and really commit yourself to making it work, it becomes something you are truly proud of. If Houston didn’t trust in all of the hard work Margaret and her team put into the Apollo 11 software, the United States might have never beat the Soviet Union to the moon. It was a make or break moment. They had to put everything on the line in order to land, and boy did it pay off.