THE READING ROOM / BOOK GUIDE
C interfaces and implementations
David R. Hanson's book shows how to build reusable C modules behind clean interfaces, using small libraries such as lists, tables, and memory pools to demonstrate the discipline of separating what a component does from how it does it.
About the book
C Interfaces and Implementations takes a working programmer's view of modularity in C. A large program is assembled from many small modules, and the quality of the boundaries between them shapes much of how the program behaves. Hanson develops this idea through a set of reusable components, each presented as an interface that clients can rely on and an implementation that can change without disturbing them.
The book's subject is the craft of designing those boundaries in a language that offers little help. C gives you headers, opaque pointers, and conventions, and Hanson leans on all three. He treats interfaces as contracts and implementations as private machinery, then shows the costs and trade-offs of keeping them apart. The components are ordinary and useful: collections, string handling, memory management, and similar building blocks that appear in real systems.
Because the material is concrete, the book reads as a sequence of design decisions rather than abstract advice. Each component raises questions about ownership, error handling, and performance that recur across software. The result is a study of how reusable C code is actually shaped, written by someone who has built such libraries and expects readers to do the same.
How to read it
Approach the book with a compiler and an editor open. The value lies in the interfaces and the reasoning behind them, and that reasoning becomes clear when you try to use a component or imagine changing its implementation. Read the interface first, form your own view of its contract, then compare it with the implementation that follows.
The prose is compact and technical, with code carrying much of the argument. Expect to move slowly through the denser components and to revisit earlier ones once later patterns become familiar. The examples are small enough to follow but detailed enough to reward attention to error paths and edge cases, which is where interface design is tested.
Who it suits
Programmers who write C in teams or maintain C libraries will find the most here, especially those who have inherited code with murky boundaries between modules. Readers learning to design APIs in any language can also profit from the emphasis on contracts and hidden implementation details. Anyone building reusable components in a systems context will recognize the problems Hanson addresses.
Reading considerations
The book's C style and tooling assumptions reflect its period; readers should expect to adapt examples to current compilers and conventions. It is a design book, not a survey of the language or a modern library reference. Test its recommendations against your own project's constraints rather than adopting them wholesale.
Follow the HN conversation
46 different recommenders are recorded in the upstream dataset. These are AI-classified source counts, not an independent rating.
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.
