The design of application programming interfaces can affect the behavior, capabilities, stability, and ease of use of end-user applications. With this book, you will learn how to design a good API for large-scale long-term projects. With extensive C++ code to illustrate each concept, "API Design for C++" covers all of the strategies of world-class API development. Martin Reddy draws on over fifteen years of experience in the software industry to offer in-depth discussions of interface design, documentation, testing, and the advanced topics of scripting and plug-in extensibility. Throughout, he focuses on various API styles and patterns that will allow you to produce elegant and durable libraries. The only book that teaches the strategies of C++ API development, including design, versioning, documentation, testing, scripting, and extensibility. Extensive code examples illustrate each concept, with fully functional examples and working source code for experimentation available online. Covers various API styles and patterns with a focus on practical and efficient designs for large-scale long-term projects.
I learned almost nothing from this, maybe the inevitable consequence of spending so much of my life at this game. You just can never tell until you've been through it.
A useful compendium of best practices for any novice though. Succinct, well organised and competently written. But oh how I wish for something of the quality of a Jon Bentley or a Herb Sutter.
This entire review has been hidden because of spoilers.
In practice, this is more a book of good development practices, a bit like Code Complete, but more concise and slightly directed towards public API development.
I didn't learn anything new, but it's a nice compilation and might be worth for beginners.
I haven't read this book cover to cover as I was already familiar with some of the concepts, like the design patterns. But being primarily a developer for C APIs, I found this book immensely useful when given the task to design a C++ API. Accidentally breaking backward compatibility is probably the biggest nightmare of any SDK developer, and this book extensively covers what you need to do to avoid it. I didn't know the ABI compatibility is so fragile in C++, and I'm sure the book has saved me a lot of headaches. After reading it I really understand why some people choose to expose their API in C even though what's underneath is full C++.
This is a really easy read. Nothing complicated, just good advices. Most of them things that I've been implementing, or already knew. But it's always interesting to reinforce our knowledge. I feel it's a book that all software engineers should read. The world would be a better place if they followed the advice herein.
The only thing I would say is arguable is the treatment of copy-on-write (COW). The opinion expressed by this author doesn't consider the arguments given by Sutter in "More Exceptional C++" item 16. The dangers of COW in multi-threaded environments.
Great first few chapters with practical advice on C++ API design; rest of the book devolved into high-level rehash of other works, a lot of it out of date.
A must read for any C++ programmer. It basically ensures that the stuff one's suppose to be aware of and know in-depth are still in the attic of the mind. It's definitely one for the shelf.