Home ๐Ÿ“š Book review: "API Design for C++" (2011)
Post
Cancel

๐Ÿ“š Book review: "API Design for C++" (2011)

Link to Amazon.

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 of C++11) of an ancient version. The auto keyword is nowhere used in the book, they write std::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.
This post is licensed under CC BY 4.0 by the author.

A not quite necessary C++23 feature: copying with auto{}

Martian Horrors ๐Ÿ‘ฝ