3 ms·
"API" has a much broader meaning than the HTTP/REST/JSON variant that everyone is familiar with. Any class, 3rd-party lib, C header file, etc. that you include
by juliangregorian 12y ago
"API" has a much broader meaning than the HTTP/REST/JSON variant that everyone is familiar with. Any class, 3rd-party lib, C header file, etc. that you include in your code can be considered to have an API - an application programming interface - as opposed to a application binary interface. I find it a great exercise when developing new code to first plan out the external API that other classes or programs will use to talk to it.
- golergka 12y agoThat's exactly what I meant. Ideally, I first write classes public interface (it's especially easy in C/C++, it's just an almost complete header file), then write some code that uses it to ensure that it is easy and intuitive to use, then unit tests, and only after that get to implementation. It's not always possible to follow this flow all the time (I work in the game industry and unit testing is seldom used, unfortunately), but I always find that I write better code when I follow it.