2: Qualities

Abstract

This chapter describes the set of language-neutral qualities that define a good application programming interface (API). This includes providing a good abstraction for the problem being solved, which is illustrated with reference to a simple address book program. A good API must also hide implementation details through a combination of physical and logical hiding techniques. The quality of minimal completeness means that an API should be as small as feasible but no smaller. An API should also be easy to use, which includes facets such as being discoverable, difficult to misuse, consistent, orthogonal, and platform independent, and making appropriate use of smart pointers such as shared pointers, weak pointers, and ...

Get API Design for C++, 2nd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.