What Counts as a Program?
Like many “firsts” in computing, the first software program depends on definition. If a program means a written sequence of instructions for a machine, the answer reaches back to the 19th century. If it means instructions stored in electronic memory and executed by a running computer, the answer comes from the late 1940s. If it means anything that controls a machine automatically, such as the patterns on a loom, it goes back even further. Each reading is reasonable, so the useful approach is to look at the steps along the way.
It also helps to separate two ideas that are easy to blur: designing a method, and having a machine actually carry it out. Many early programs were written before any machine could run them.
Control Without Computers
Long before computers, machines were controlled by physical patterns. Music boxes and player-piano rolls used pins or holes to represent notes. In the early 1800s, the Jacquard loom used punched cards to select which threads were lifted for each row of a pattern, so that changing the cards changed the cloth. This was control by stored patterns, but the loom did not calculate or make decisions, so most historians treat it as a forerunner and not as software in the modern sense.
Lovelace’s Notes
The best-known early candidate comes from the 1840s. Charles Babbage had designed the Analytical Engine, a proposed mechanical machine that would read instructions from punched cards. Ada Lovelace translated an article about it by an Italian engineer, Luigi Menabrea, and added extensive notes of her own, which were longer than the original article.
One of those notes laid out, in a table, a step-by-step method by which the engine could compute a sequence of numbers known as Bernoulli numbers. It is often described as the first published computer program. That description is defensible but contested. Some historians point out that Babbage had already sketched similar programs in his own papers, and that the extent of Lovelace’s personal contribution to the table is debated. Others stress that her wider insights, including the thought that such a machine might manipulate symbols representing things other than numbers, were distinctive. The engine was never built, so the program was never run on it.
Programming by Wiring and Tape
When working machines arrived in the 1930s and 1940s, programming took physical forms. Some machines read instruction sequences from punched paper tape. Konrad Zuse, who built calculating machines in Germany, also worked on a notation for describing programs, now called Plankalkül, which he developed in the 1940s. It was not implemented on a machine at the time, so it is better seen as an early design for a programming language than as running software.
On the early electronic machine known as ENIAC, a program meant setting switches and connecting cables. Teams of mathematicians, many of them women, worked out how to arrange a problem into steps the machine could follow. This is an important reminder that early programmers did real intellectual work even when the “code” was a pattern of cables. Changing to a new problem could take a long time, and that inconvenience helped motivate the next step.
Stored Programs Run
The decisive change was keeping the program in the same electronic memory as the data, a design known as the stored-program concept. Instructions could then be loaded quickly, modified by the machine itself and reused. In the late 1940s, experimental machines in Britain put the idea into practice. A small machine at the University of Manchester ran a short program in 1948, and it is widely cited as one of the earliest programs to run from electronic memory. A machine at Cambridge, EDSAC, began operating in 1949 and was soon used for real scientific work.
At Cambridge, the team also recognized that programs would need to be reused. They developed a library of subroutines, ready-made pieces of code that could be copied into new programs. This practice, along with early assembly notations that let programmers use short names instead of raw numbers, started to make programming look like a distinct discipline.
Software Gets Its Name
In these first years, people usually talked about “coding” or “setting up” the machine. The word “software” came into wider use later, in the late 1950s, as machines grew more capable and programs became valuable assets in their own right. Around the early 1950s, Grace Hopper and colleagues developed some of the first compilers, programs that translate higher-level instructions into machine code. This was a step toward the programming languages that followed, making it possible to write instructions in forms closer to human language and mathematical notation. The difference between compilers and interpreters, two ways of turning such text into running code, became a standard topic as languages multiplied.
Behind all of this lay the idea behind computer algorithms in general: a clear procedure that can be carried out step by step. The tables in Lovelace’s notes, the cable layouts of ENIAC and the instruction lists of EDSAC were all different ways of writing such procedures down.
So, Which Was First?
There is no single correct answer, but there are sensible ones. For a published program designed for a general-purpose machine, the 1840s notes are the usual choice, with the caveat that the machine never existed. For a program run on an automatic machine, 1940s tape-driven and wired systems qualify. For a program run from electronic memory, the 1948 and 1949 British experiments are the standard answer. Treating them as stages of one long development, and not as rival claims, is probably the most accurate way to see them.