What it argues
Code is Charles Petzold's explanation of how computers work, built from first principles. Beginning with children sending messages to each other by flashlight and working through Morse code, Braille, Boolean algebra, transistors, logic gates, memory, processors, and operating systems, the book constructs a computer from the ground up conceptually. By the end, the reader understands not just that computers can add numbers but why they can, and how that simple capability extends to everything computers do.
The book's approach is genuinely unusual among computer science texts. Petzold does not assume the computer exists and explain its properties. He constructs it: starting from the physical phenomenon of electricity, moving through the relay (an electromagnetically operated switch) to demonstrate the logic gates that underlie all digital computation, then to Boolean algebra (which provides the mathematical framework for combining those gates), then to the circuits that can store binary information, then to the adders and memory and control circuits that together constitute a processor.
What it gets right
- 1.
A computer is a logic machine built from switches that can be combined to perform Boolean operations — AND, OR, NOT — and those operations, combined, can implement any computation.
- 2.
Binary representation — encoding everything as sequences of 0s and 1s — is not an arbitrary choice but follows from the physical properties of two-state devices like transistors and switches.
- 3.
Boolean algebra, developed by George Boole in the 1850s for the algebra of logic, turned out to describe electronic circuits perfectly — a connection Charles Shannon demonstrated in his 1937 master's thesis.
What it covers
Who wrote it
Charles Petzold is an American programmer and author who spent most of his career writing about Microsoft Windows programming. His earlier books include Programming Windows, which was the definitive reference for Windows application development for years. Code was his first book intended for general audiences rather than practicing programmers. He also wrote The Annotated Turing, a detailed walkthrough of Alan Turing's 1936 paper on computable numbers. Petzold has received numerous honors from the computing industry for his educational writing.