API Design For C++ | Beginners To Expert

image

Who should take this book?

If you write C++ code that another engineer relies upon, you’re an API designer and this book has
been written for you.

Interfaces are the most important code that you write because a problem with your interface is far more costly to fix than a bug in your implementation. For instance, an interface change may require all of the applications based on your code to be updated, whereas an implementation-only change can be integrated transparently and effortlessly into client applications when they adopt the new API version. Put in more economic terms, a poorly designed interface can seriously reduce the long term survival of your code. Learning how to create high-quality interfaces is therefore an essential engineering skill, and the central focus of this book.

As Michi Henning noted, API design is more important today than it was 20 years ago. This is because many more APIs have been designed in recent years. These also provide richer and more complex functionality and are shared by more end-user applications (Henning, 2009). Despite this fact, no other books currently on the market concentrate on the topic of API design for C++. It’s worth noting that this book is not meant to be a general C++ programming guide there are already many good examples of these on the market. I will certainly cover lots of object-oriented design material and present many handy C++ tips and tricks. However, I will focus on techniques for representing clean modular interfaces in C++. By corollary, I will not dive as deeply into the question of how to implement the code behind these interfaces, such as specific algorithm choices or best practices limited to the code within the curly braces of your function bodies.

However, this book will cover the full breadth of API development, from initial design through implementation, testing, documentation, release, versioning, maintenance, and deprecation. I will even cover specialized API topics such as creating scripting and plugin APIs. While many of these topics are also relevant to software development in general, the focus here will be on the particular implications for API design. For example, when discussing testing strategies I will concentrate on automated API testing techniques rather than attempting to include end-user application testing techniques such as GUI testing, system testing, or manual testing.

In terms of my own credentials to write this book, I have led the development of APIs for research code shared by several collaborating institutions, in-house animation system APIs that have been used to make Academy Award-winning movies, and open-source client/server APIs that have been used by millions of people worldwide. Throughout all of these disparate experiences, I have consistently witnessed the need for high-quality API design. This book therefore presents a practical distillation of the techniques and strategies of industrial-strength API design that have been drawn from a range of real world experiences.

While this book is not a beginner’s guide to C++, I have made every effort to make the text easy to
read and to explain all terminology and jargon clearly. The book should therefore be valuable to new
programmers who have grasped the fundamentals of C++ and want to advance their design skills, as
well as senior engineers and software architects who are seeking to gain new expertise to complement their existing talents.

There are three specific groups of readers that I have borne in mind while writing this book.

  1. Practicing software engineers and architects. Junior and senior developers who are working on
    a specific API project and need pragmatic advice on how to produce the most elegant and
    enduring design.
  2. Technical managers. Program and product managers who are responsible for producing an API
    product and who want to gain greater insight into the technical issues and development processes
    of API design.

Download PDF

Happy learning!

8 Likes

Thank You @BlueHacker :))

But I would like to add something to this thread in the form of a Beginner friendly course, absolutely from scratch. Doesn’t talk about how to build one specifically, but does a excellent job in understanding why API’s are so important and how to use them.

1 Like