The word 'code' has one of the most remarkable semantic journeys in English, traveling from a tree trunk to computer programming through a chain of metonymic transfers spanning two millennia. Each step in its evolution involves the substitution of a container for its contents, or a material for its product — a cascading series of conceptual leaps that transformed a piece of wood into an abstraction.
The story begins with Latin 'caudex' (also spelled 'cōdex'), which meant 'the trunk of a tree' — specifically, the main stem stripped of its branches. Because Romans wrote on tablets made from split and wax-coated wood, 'caudex' transferred from the material (tree trunk) to the object made from it (wooden writing tablet). From a single tablet, it extended to a set of tablets bound together — a book. And from a book, it extended to the most important books in Roman law: systematic compilations of statutes and regulations, most famously
The word entered English via Old French 'code' around 1300, initially meaning 'a systematic collection of laws or regulations' — the sense preserved in 'legal code,' 'building code,' 'code of conduct,' and 'penal code.' This is 'code' as a structured system of rules.
The 'secret cipher' sense emerged around 1808, though the practice of encoding messages is ancient. A 'code' in this sense is a system for converting a message into a form that conceals its meaning from unauthorized readers. This sense extended the 'system of rules' meaning: a cipher code is a systematic set of rules for transforming text. The verb 'to code' (to write in cipher) followed, along with 'encode' (to put into code) and 'decode' (to extract from code).
The computing sense emerged in the mid-1940s, when the pioneers of electronic computing adapted the cipher meaning to describe the instructions written for a machine. 'Code' was a natural choice: like a cipher, computer code is a system of symbols that must be translated (compiled or interpreted) to produce its intended effect. Grace Hopper, who worked on the Harvard Mark I in 1944, was among the early users of 'code' in the programming sense. By the 1950s, 'source code,' 'machine code,' 'coding,' and 'coder' were established
The Latin root 'caudex' also produced 'codex' (a manuscript volume, especially of an ancient text), 'codify' (to arrange laws or rules into a systematic code), 'codicil' (a supplement to a will, literally 'a little book'), and 'codec' (a twentieth-century blend of 'coder-decoder,' a device or program that encodes and decodes data). In classical Latin, 'caudex' had a colloquial meaning of 'blockhead' — a person as dense as a tree trunk — making the ancestor of 'code' also the ancestor of an insult.
The full journey — tree trunk → wooden tablet → bound book → law book → system of laws → secret cipher → computer instructions — is a textbook case of how meaning evolves through chains of metonymy, each step perfectly logical in context, the cumulative result almost unrecognizable from the starting point.