Curiosity about lines of code

How many lines of code does it take to get to the center of Gale Crater?

NASA's Curiosity rover successfully landed on Mars this week, to the great relief - and joy - of many. Now, of course, the fun part begins: letting this Mini Cooper-sized nuclear-powered mobile scientific laboratory explore the red planet.

We all know that simply getting the rover there in one piece was an amazing technical, engineering and scientific accomplishment, but what about Curiosity itself? Inquiring developers want to know just how much (and what kind) of code it takes to run the thing.

The answer: 2.5 million lines of C.

Sounds like a lot, yes? Well, is it really? How many lines of code did it take to power other spacecraft? And how does that stack up to the amount of code needed to power more down-to-earth applications?

To answer these questions, ITworld has assembled the following chart to give this some historical perspective. Behold...

Notes/Data Sources:

Apollo 11 - LOC for Apollo Guidance Computer (AGC); Source: computed by based on code for the Comanche055, Luminary099 and FP8 modules in

Space Shuttle - LOC for primary flight software; Source:

Curiosity - LOC for Rover Compute Elements (RCE): Source:

Android - LOC for Android version 2.2; Source:

Windows - LOC for Windows XP; Source:

Mac OS X - LOC for version 10.4; Source:

Clippy: Wild guess; we really have no idea

As you can see, the volume of code to power the Curiosity rover is quite a bit more than either the Apollo Guidance Computer (AGC) that powered Apollo 11 (the code for which, by the way, you can now download), or the primary flight software of the space shuttle. However, the code volume for Curiosity is puny compared that required to power (earlier) versions of Windows, OS X and Android.

Now, to be fair, lines of code is not a great way to measure computing power (here's a better comparison of Curiosity's computing power to that of a smartphone) and, of course, Apollo engineers were greatly restricted by the hardware available at the time. Also, the LOC measurements for the AGC, space shuttle and Curiosity don’t take into account all of the code required to make their flights happen (e.g., for all associated flight and ground systems).

However, this chart does, I think, demonstrate the basic fact that the code required to power a spacecraft just isn't as complex as that required to power a modern OS for a device that you can use to take a GPOY and post to Twitter. Unlike Windows, OS X or Android, these code bases don’t have to support complicated graphics or user interfaces, or simply the sheer volume of tasks, that a Windows or Andoid does.

If a tool that needs to perform lots of seemingly mundane tasks requires such a large volume of code, one can only imagine (and, as you can see, I do) what was required to power Clippy back in the day. I shudder at the thought...

Free Course: JavaScript: The Good Parts
View Comments
You Might Like
Join the discussion
Be the first to comment on this article. Our Commenting Policies