Writing Great Libraries: 89 Easy Steps
summary
Claims that library APIs must be maximally efficient and impossible to use incorrectly, with names that are obvious and interfaces easy to reason about. Converts a bad index/get pointer API to an array-fill then to a lazy range, shows XOR-swap fixes and that copying-by-value often yields the tightest code, and argues to avoid raw/shared pointers and aliasing. Recommends Boost.Iterator for custom iterators, using expression templates to fuse a*x+y into BLAS-style ops, SFINAE plus static_asserts for clearer template errors, .ipp include patterns for optional header-only builds, and inline namespaces for versioning.
AI-written summary · about
chapters (8)
- 0:00Introduction and motivation
- 8:06Efficiency in library design
- 13:49Usability and naming conventions
- 20:47Making code easy to reason about
- 27:35Composability and regular types
- 35:18Striving for ideal interfaces
- 41:52Implementation tips and documentation
- 48:56Q&A session
related talks
32mC++ Standard Library "Little Things”
01h 01mEasy to Use, Hard to Misuse: Declarative Style in C++
54mWriting C++ to Be Read
01h 12mComparison of C++ Performance Optimization Techniques for C++ Programmers
01h 00mBuilding and Extending the Iterator Hierarchy in a Modern, Multicore World
01h 24mKeynote: Optimizing for Change
01h 22mSimplicity: not just for beginners
01h 33mSafe and Sane C++ Types
