3 ms·
While it's ostensibly about C, David Hanson's _C Interfaces and Implementations_ (http://sites.google.com/site/cinterfacesimplementations/ http://sites.google.c
by silentbicycle 16y ago
While it's ostensibly about C, David Hanson's _C Interfaces and Implementations_ (http://sites.google.com/site/cinterfacesimplementations/ http://sites.google.com/site/cinterfacesimplementations/) has a lot of good discussion about API design for libraries, how to handle errors gracefully, etc. Many points apply just as well to libraries in OO or functional languages, REST APIs, etc., because questions about who should be responsible for error checking, managing resources, etc., are going to come up in any API design.
It's also a good example of literate programming, and one of the best C books I've read.
I'd also recommend against _Design Patterns_, because while some of the API design discussion is good, much of it is too entangled with workarounds for quirks in C++'s object system. Visitor is irrelevant if you have multimethods, Singleton is a non-issue if you have a prototype-based object system, etc., but this isn't clear. C's lack of a specific object system makes the focus on API design clearer in CII.
- test4service 16y agodummy comment - sorry guys, i'm trying this out