3 ms·
IMO "public" facing APIs should always be easy to use and only require the minimum information from the user necessary. An example of an outstanding public API
by umvi 6y ago
IMO "public" facing APIs should always be easy to use and only require the minimum information from the user necessary. An example of an outstanding public API would be nlohmann's json library for C++[0].
Whether that API is merely a wrapper for an internal API that is more testable (i.e. allows injection, etc.) or whatever is another matter.
[0] https://github.com/nlohmann/json https://github.com/nlohmann/json
- allenu 6y agoI think there can be debate on what is "minimum information". I'd also say "easy" for one developer may be challenging for another developer if the domain of the model is foreign to them. A lot of frameworks require up-front knowledge to work with. To some, that's not "easy", but it allows the client to do so much because what the framework is providing is not simple. In other places, the API can be dead easy because what it's providing is so simple.