A full century before electronic computers, Charles Babbage designed a general-purpose programmable machine, and Ada Lovelace wrote the first program for it. Neither was ever built in their lifetimes, but the ideas were exactly right.

The idea

Separate the machine from the program. Babbage’s Analytical Engine was general-purpose, and Lovelace saw that a program, an algorithm with loops and variables, is a thing in its own right, distinct from the hardware that runs it.

The Analytical Engine

Babbage’s Analytical Engine was a proposed general-purpose mechanical computer, distinct from his earlier, single-purpose Difference Engine. Lovelace likened it to the Jacquard loom, which was directed by punched cards, and that analogy is apt: the cards carried the instructions, separate from the machine itself. A general machine plus an exchangeable program is the architecture of computing.

Note G

In 1843 Lovelace published Note G, an algorithm to compute Bernoulli numbers on the Analytical Engine. It is generally considered the first algorithm written specifically for a computer, which is why Lovelace is remembered as the first computer programmer. Note G has the shape of real code: it loops, it reuses intermediate results, it operates on indexed variables.

Why it matters

The idea that a machine could be general, and directed by a program you swap out rather than rebuilt, is the idea every computer rests on. It would be realized electronically a century later in the stored-program computer. The Defense Department’s Ada programming language is named in Lovelace’s honor.

Sources

  • “Note G,” Wikipedia. https://en.wikipedia.org/wiki/Note_G . Supports Ada Lovelace’s Note G (published 1843) as an algorithm to calculate Bernoulli numbers using Babbage’s Analytical Engine, its standing as generally considered the first algorithm specifically for a computer with Lovelace as the first computer programmer, and the Analytical Engine as a general-purpose machine directed by punched cards.