HackerTube.live
Books / Computer Science

THE READING ROOM / BOOK GUIDE

Code

Charles Petzold

Charles Petzold begins with two children and a flashlight, then builds from that signal toward logic gates, processors and software. The book explains how machines come to hold and act on information.

About the book

Code works upward from elementary ideas about encoding. Petzold starts with simple signaling between two people and treats every later layer as an extension of that problem: how do you represent meaning with a limited set of distinguishable states? The answer carries the reader through binary codes, electrical circuits and the logic that links them.

The book is a cumulative explanation. Each mechanism appears because the previous one creates a need for it. Petzold writes for readers who want the reasoning behind digital systems, not a manual for using them. The result is a patient account of how switches, relays and transistors can be arranged to count, store values and execute instructions.

Petzold's background in programming shapes the emphasis. He treats software and hardware as two views of the same set of encoding decisions, and he keeps returning to what a machine can represent and manipulate. Diagrams and worked examples do much of the explanatory work.

How to read it

Read in order. The argument is cumulative, and skipping early material about codes and circuits will make later discussions of memory and processors harder to follow. Keep paper or a notebook nearby for the binary and logic exercises; working them out is part of understanding the text.

The prose is clear and unhurried, but the density rises as the book moves from switches to adders and instruction sets. Expect to reread some passages. The examples are deliberately small, which makes them tractable but also means the book stops short of describing a modern commercial processor in detail.

Who it suits

This suits curious general readers who want a genuine mental model of how computers work, and students entering computer science who need the conceptual foundation beneath programming courses. Programmers who learned to code without studying hardware will find the lower layers explained in plain terms. Readers who prefer abstract theory or a fast overview should look elsewhere.

Reading considerations

The first edition predates much of the hardware landscape readers now encounter, so treat specific device examples as historical illustrations of enduring principles. Later editions expand and update some material; check which edition you have before relying on page references. The book explains mechanisms but does not teach practical electronics or programming.

Follow the HN conversation

243 different recommenders are recorded in the upstream dataset. These are AI-classified source counts, not an independent rating.

Read ezedv’s original comment (2023-07-26) ↗

Search HN comments about this book ↗

Explore videos on the same subject ↗

Book notes prepared with DeepSeek, using catalogue records and Open Library subject information. They are reading guidance, not a personal review or a verified chapter-by-chapter account. Book details can vary by edition. HN data methodology · Book metadata and covers.