Computer program
A sequence of instructions executed by a computer.
A computer program is a list of commands, written in a programming language, that a computer follows. It forms part of a larger whole called software, which also includes things like documentation and other non-physical parts. When a program is written in a way humans can read, it is known as source code. Because computers only understand their own native machine instructions, source code needs another program to run. It can be turned into machine instructions by a compiler designed for that language (assembly language uses an assembler for this), producing a file called an executable. Alternatively, an interpreter can read and run the source code directly.
If an executable is asked to run, the operating system loads it into memory and starts a process. The central processing unit then takes over, fetching, decoding, and executing each machine instruction. If source code is run instead, the operating system loads the interpreter into memory, starts a process, and the interpreter loads the source code to translate and run each statement one by one. Running source code this way is slower than running an executable, and the interpreter must already be installed on the machine.
A common example is the "Hello, World!" program, which shows a language's basic rules. The BASIC language (from 1964) was deliberately kept simple to learn. For instance, variables don't need to be declared before use, and they start at zero automatically. Here is a BASIC program that averages a list of numbers:
[Example program omitted as per source]
Once the basics of programming are understood, more advanced and powerful languages can be used to create large computer systems.
History
Progress in software has come from progress in computer hardware. At each stage of hardware development, the nature of programming changed dramatically.
The Analytical Engine (1837) was inspired by Jacquard's loom. Charles Babbage tried to build it, borrowing names from the textile industry. The device had a "store" (memory) holding 1,000 numbers of 50 decimal digits each, and a "mill" for processing. Two sets of perforated cards programmed it: one set directed operations, the other input variables. However, the thousands of gears never worked together. Ada Lovelace wrote a description of the engine in 1843, including Note G, which fully detailed a method for calculating Bernoulli numbers. Some historians call this the world's first computer program.
In 1936, Alan Turing described the Universal Turing machine, a theoretical device that can model any computation. It is a finite-state machine with an infinitely long read/write tape. The machine moves the tape back and forth, changing its contents as it runs an algorithm. It starts in an initial state, follows a sequence of steps, and stops when it reaches a halt state. All modern computers are Turing complete.
The ENIAC (Electronic Numerical Integrator And Computer) was built from July 1943 to fall 1945. It was a Turing complete, general-purpose computer using 17,468 vacuum tubes. It was essentially a series of Pascalines wired together. Its 40 units weighed 30 tons, took up 1,800 square feet, and cost $650 per hour (in 1940s money) in electricity when idle. It had 20 base-10 accumulators. Programming it took up to two months. Three function tables on wheels were rolled to fixed function panels, connected by plugging heavy black cables into plugboards. Each table had 728 rotating knobs, and programming also involved setting some of the 3,000 switches. Debugging took a week. It ran from 1947 to 1955 at Aberdeen Proving Ground, calculating hydrogen bomb parameters, predicting weather, and producing artillery firing tables.
Stored-program computers changed everything. Instead of plugging cords and turning switches, these machines load instructions into memory just like data. This allowed quick programming and very fast calculations. Presper Eckert and John Mauchly built the ENIAC and introduced the stored-program concept in a three-page memo from February 1944. In September 1944, John von Neumann joined the ENIAC project. On June 30, 1945, he published the First Draft of a Report on the EDVAC, comparing computer structures to the human brain. This design became known as the von Neumann architecture, and it was used in both the EDVAC and EDSAC computers in 1949.
The IBM System/360 (1964) was a family of computers sharing the same instruction set architecture. The Model 20 was the smallest and cheapest; customers could upgrade and keep the same software. The Model 195 was the most premium. Each model supported multiprogramming—holding multiple processes in memory at once, so one could compute while another waited for input/output. IBM planned for all models to be programmed in PL/I. A committee of COBOL, FORTRAN, and ALGOL programmers was formed to create a language that was comprehensive, easy to use, extendible, and would replace COBOL.
- early_example_language
- BASIC (1964)
- stored_program_concept
- February 1944 memo by Eckert and Mauchly
- von_Neumann_architecture
- First Draft of a Report on the EDVAC (June 30, 1945)
Lore & Background
A computer program is a sequence of instructions written in a programming language that a computer can execute. It is a core component of software, which also includes documentation and other non-executable elements. In its human-readable form, a program is called source code. Because computers only understand native machine instructions, source code must be translated into an executable file using a compiler, or it can be run directly by an interpreter. When an executable is requested, the operating system loads it into memory and starts a process; the central processing unit then fetches, decodes, and executes each machine instruction. Running source code through an interpreter is slower than running a compiled executable, and the interpreter must be installed on the computer. A simple example is the "Hello, World!" program, which illustrates a language's basic syntax. The BASIC language, for instance, was designed to be easy to learn: variables do not need to be declared before use and are automatically initialized to zero. The history of programming is tied to hardware advances. In 1837, Charles Babbage, inspired by Jacquard's loom, designed the Analytical Engine, which had a store (memory for 1,000 numbers) and a mill (for processing), programmed using two sets of perforated cards. Ada Lovelace's Note G detailed a method for calculating Bernoulli numbers on this engine, recognized as the world's first computer program. Alan Turing's 1936 Universal Turing machine, a theoretical finite-state machine with an infinitely long tape, can model every computation; all modern computers are Turing complete. The ENIAC, built from 1943 to 1945, used 17,468 vacuum tubes and weighed 30 tons. Programming it took up to two months, using three wheeled function tables with 728 knobs each, plugboards with heavy cables, and 3,000 switches; debugging a program took a week. The stored-program concept, introduced in a 1944 memo by Presper Eckert and John Mauchly, allowed computers to load instructions into memory like data, enabling rapid reprogramming. This design, formalized by John von Neumann in 1945, became known as the von Neumann architecture and was deployed in the EDVAC and EDSAC computers in 1949. The IBM System/360, introduced in 1964, was a family of computers sharing the same instruction set architecture.
Reader's Guide
The stored-program concept, introduced by Presper Eckert and John Mauchly in a February 1944 memo, allowed computers to load instructions into memory like data, enabling quick programming and fast calculations. John von Neumann published the First Draft of a Report on the EDVAC on June 30, 1945, equating computer structures with the human brain, leading to the von Neumann architecture deployed in the EDVAC and EDSAC in 1949. Improvements in software development are the result of improvements in computer hardware. A computer program is a sequence of instructions in a programming language for a computer to execute, forming one component of software alongside documentation. In human-readable form, it is called source code, which must be translated by a compiler into machine instructions to create an executable file, or executed line-by-line by an interpreter, which is slower and requires the interpreter to be installed. The operating system loads an executable into memory and starts a process, with the CPU fetching, decoding, and executing each instruction. For source code, the interpreter is loaded first, then translates each statement. The "Hello, World!" program demonstrates basic syntax, as in the BASIC language from 1964, which intentionally limited syntax for ease of learning—variables need not be declared and are automatically initialized to zero. An example BASIC program averages numbers by prompting for a count, summing inputs in a loop, dividing by the count, and printing the result. Once basic programming mechanics are learned, more powerful languages enable building large computer systems.
Did You Know?
- The Analytical Engine's store could hold 1,000 numbers of 50 decimal digits each.
- The Intel 4004 microprocessor was originally designed for a Japanese calculator company, Busicom.
More in Computing & Digital 1-24
Spotted an error? Know more?
This is a living reference — every entry is fact-audited, and reader corrections feed straight into our audit queue. Suggest an edit · See this site's audit record
