Where does the phrase “run code” or “run software” come from? Why “run”?

It seems to have been a natural extension of the usage of "run" which is used as a synonym for to operate or to cause to operate. An example being "The engine is running."

If I had to speculate, that particular meaning could have come from the speedy motion one can observe, for instance, seeing an engine operating. This is pure conjecture, however, since there are also other correct usages of the word run which are entirely procedural in nature, e.g. "To run a business."


Where does the phrase “run code” or “run software” come from? Why “run”?

Run

As detailed in another question, run is now the word with the most meanings in the Oxford English Dictionary. From the New York Times:

It took Peter Gilliver, the O.E.D. lexicographer working on the letter R, more than nine months harnessed to the duties of what Samuel Johnson once called “a harmless drudge” (plus many more months of preparatory research) to work out what he believes are all the meanings of “run.” And though some of the senses and their derivations try him — Why does a dressmaker run up a frock? Why run through a varlet with a sword? How come you run a fence around a field? Why, indeed, run this essay? — Mr. Gilliver has finally calculated that there are for the verb-form alone of “run” no fewer than 645 meanings. A record.

As run is so versatile, it comes as no surprise that it was applied to computers and computer programs from the earliest days of computers.

An earlier related meaning in the OED is the verb to keep or operate machinery, for example from 1840:

The farmers would find it difficult to run a mill to make cloths, or to build and sail a ship to take his produce to market.

And the noun, the act of making machinery run from 1864:

The Blue Gravel claim (placer) at Smartsville, cleared up, after a run of two weeks of their mill, the sum of $44000.

The first electronic digital computers were developed between 1940 and 1945 and it's not surprising the earliest relevant OED entry for the noun run is from 1941.

IV. Senses relating to the operation or management of something.

IV 50 d. Computing. An instance of the execution of a program or other task by a computer.

1941 Jrnl. Amer. Statist. Assoc. 36 513 While a maximum of 54 runs through the tabulator is required, only one-ninth of the cards are used during each run.

The verb follows from this:

V. To (cause to) operate or function.

79. d. (a) trans. Computing. To perform (a computation) on a computer; to cause the instruction in (a program) to be carried out, to execute. Cf. run n.2 50d.

1946 Man. Operation Automatic Sequence Controlled Calculator (Harvard Computation Lab.) vi. 289 A clear copy of the coding must be provided before an attempt is made to run a sequence tape on the calculator.

Code

Modern computer programs are software written with a programming language, and software can be run on a computer. A program is a special code that a computer process and can understand, and software is also known as a code. (Writing a program is also known as coding.) Early programs were "written" by punching holes in tape in a special sequence, or code, that the computer could process and execute, or run.

This meaning of code also comes from the early days of computing. The OED:

3. c. Cybernetics. Any system of symbols and rules for expressing information or instructions in a form usable by a computer or other machine for processing or transmitting information.

1946 Nature 26 Oct. 568/1 The brains of the machine lie in the control tape, which is code-punched in three sections.


The first general purpose computers were large machines. They did not execute the typical stored instruction programs that we have today. Each instruction had to be wired by hand by connecting terminals on plugboards with one or more patch cables. This sometimes took days to complete and verify. Once the program was "wired", the machine could be turned on and allowed to run.

run : 7 be in or cause to be in operation; function or cause to function

etymology: of machinery, from 1560s.

From The ENIAC Story:

Coders, programmers, and engineers made it run and produced useful results which otherwise would have been unattainable. The rapid progress of computer technology, spurred by the ENIAC itself ...


It's a normal metaphor for computing. If you think about it, all computing terms are bound to be metaphors, since it's too new a phenomenon to have established terms.

And Running Fast is one of the most common. Running is something people and other animals do; it's an extension of the body, like almost all metaphors. And it's something that some are better at than others. Speed is part of that, but we also speak of Running Light or Running Well.


From New monthly magazine: Volume 21 (1827)

we will just run through it, and glance at its most successful points.

where I read "run" as equivalent to "step quickly through". That's what computers have always done - stepping ever more quickly through ever more complex instruction sequences. There's also of course the long-standing sense of running a business (executing the procedures that businesses concern themselves with).

Programmers working at the detailed level run code (simple sequences being tested), and geeks run software. Everyone else uses/starts a program - or more likely an app nowadays.