Jump to ratings and reviews
Rate this book

C Interfaces and Implementations: Techniques for Creating Reusable Software

Rate this book
creating reusable software modules; they are the building blocks of large, reliable applications. Unlike some modern object-oriented languages, C provides little linguistic support or motivation for creating reusable application programming interfaces (APIs). While most C programmers use APIs and the libraries that implement them in almost every application they write, relatively few programmers create and disseminate new, widely applicable APIs. C Interfaces and Implementations shows how to create reusable APIs using interface-based design, a language-independent methodology that separates interfaces from their implementations. This methodology is explained by example. The author describes in detail 24 interfaces and their implementations, providing the reader with a thorough understanding of this design approach. Features of C Interfaces and * Concise interface descriptions that comprise a reference manual for programmers interested in using the interfaces. * A guided tour of the code that implements each chapters interface tp help those modifying or extending an interface or designing related interfaces. * In-depth focus on algorithm how to packag

544 pages, Paperback

First published August 30, 1996

19 people are currently reading
329 people want to read

About the author

David R. Hanson

5 books1 follower

Ratings & Reviews

What do you think?
Rate this book

Friends & Following

Create a free account to discover what your friends think of this book!

Community Reviews

5 stars
34 (45%)
4 stars
28 (37%)
3 stars
5 (6%)
2 stars
6 (8%)
1 star
2 (2%)
Displaying 1 - 4 of 4 reviews
Profile Image for David Lindelof.
44 reviews19 followers
March 21, 2012
Easily one the top three books on C that I know about. The author builds what amounts to a "Commons" library of code for C, and does this step by step, explaining every single detail through the use of Literate Programming. It's almost like sitting next to a master programmer as he explains what he's doing, the rationale behind every single decision.

On the downside, it does tend to become a little bit repetitive at times, especially when similar methods are written for different modules, such as, say, put()-like operations for stacks, sets and/or rings.

Nevertheless, this book is a must-read for any C programmer who claims to take his craft seriously. The last chapter on implementing threads is worth the book's price alone.
Profile Image for Liquidlasagna.
2,901 reviews99 followers
February 8, 2022
Probably the best advanced C book in existance...

Clearly written and well organized, this book presents more than 20 highly useful library interfaces for containers, string management, mathematics, and memory management. There isn't a line of code in the whole book that you couldn't take and use, verbatim, in a project today, after reading this book, you'll probably never have a compelling reason to write a string library or a hash table interface again.

More importantly, though, each example library illustrates ways to effectively design consistant and useable library interfaces, from generic ADTs to system service wrappers. After reading this book, you'll not only have an arsenal of useful code to leverage, but also a good understanding of how to design clean, modular, reuseable components for your application.

Hanson's C code is extremely clear and concise. Even if you've been programming professionally for a long time, you are likely to pick up a useful technique or two just by reading the source code in the book. If you're not very experienced, you will learn about C programming idioms that will be valuable to you in future work.

I really like how this book, and Hanson's other book 'A Retargetable C Compiler: Design and Implementation' are put together. Hanson employs Literate Programming techniques to weave the code he's discussing together with his discussion. This makes it very simple to track what portions of the code are being talked about at any point.

tqbf San Francisco
Profile Image for David.
259 reviews30 followers
March 24, 2008
This book is an example of literate programming a la Knuth: each chapter discusses some library and also provides a complete implementation of that library. Includes, among other things, implementations of: a pool-based low-level memory manager; a thread system; extended and arbitrary arithmetic; and throw/catch style exception handling. I remember learning a lot of little C tricks from this book, and I'd like to think that some of the design lessons have influenced me as well.
Displaying 1 - 4 of 4 reviews

Can't find what you're looking for?

Get help and learn more about the design.