The teamlead of a neighboring team recommended me this book. He absolutely loved it ๐คฉ But I had controversial impressions ๐ค
What is an API? The book says:
An API is a logical interface to a software component that hides the internal details required to implement it.
We are surrounded by different APIs, even a single program has multiple APIs. The book explores questions related to API design in C++.
The book quite clearly separates โgeneral principles of API designโ and โspecific issues of API design in C++โ.
The first component, as the philosophical one, is indeed very nice โ there are a lot of sensible ideas, hints, as well as examples of the API of popular projects. The book helps you understand what issues a software architect is thinking about so that the API does not become non-usable in a few weeks ๐
The second component, as the technical one, in my opinion, is weak. Here are some of the cons that I didnโt like:
- The book was published in 2011, it describes features of
C++0x
(the working title ofC++11
) of an ancient version. Theauto
keyword is nowhere used in the book, they writestd::vector<double>::iterator
by hand, and so on. - Some paragraphs are written by Captain Oblivious, for example
Avoid #define for constants
. - Very little said about ABI compatibility, exactly one page with trivial information. Without mentioning tools like abidiff and specific recommendations.
- Static and dynamic libraries are described only in the last 10 pages of the 450-pages long book, also with trivial information.