Bạn có chắc chắn muốn xóa bài viết này không ?
A, P, I - put together the words
A, P, I - put together the words
For now, I'm mentoring some of my friends on how to develop software. They are smart ones, they know how to code but haven't had any exposure at all to the software development process. The first rock I stumble upon was to explain to them what, why and how to do API (Application Programming Interface, in its broadest meaning).
For god sake, I'm a lazy person so I just want to search the Internet for some blog posts or lectures, that usually will explain it better than me. But no, there's no such single article that presents my understandings. The Wikipedia post is good but it's rendered unlearnable by newbie. Finally, I feel the urge to write a post myself!
API - an overloaded term
P/S: The best way to learn from this article, is to first read it from top down, then read it again from bottom up, per the unit of each section.
Thanks to the rise of cloud computing and microservice architecture, the meaning of word API in common sense has nearly been superseded by Web API (i.e. API exposed through a network, mostly Internet).
When business people refer to API, they always mean Web API.
This one, although should be put far down the learning path, always appear in the first Google results.
SDK (Software Development Kit)
API is not SDK and vice versa. They are different concepts anyway.
SDK is a term under the umbrella of technology. Technology provider may give you an SDK so you can build software that utilizes or applies their technology. (e.g. You can use Kinect SDK for Windows to apply Kinect technology)
An SDK is a toolkit. The toolkit comprises of tools. And there's mostly always an API inside it. API is a tool in terms of SDK.
SDK usually consists of at least one API.
API may be provided alone or within an SDK.
What's crucial here, is the new understanding of API arising from the view of API as a tool.
When application software developers refer to API, they mostly mean the API as a tool.
To be clear application software developers is who design or implement User Interface, not who design or implement API. They only make use of API_s. The understanding of _API as a tool is enough for them...
Programming Interface - the P and I
... but not for API developers, who create the API.
User Interface and Programming Interface are vastly different. Users are living people that can adjust their behavior to adapt the interface, while a computer is a mindless machine which hardly does that (only if consciously instructed to do so with huge effort).
Application developer can utilize the common sense of people to make User Interface. API developers only have some community conventions which is served only as a reference and cannot be relied upon.
The red close button in the corner of a window can be used to quit the entire program, or just minimize it - based on which program it is. A user may be confused if the behavior is not what they expect in the first place, but he can quickly learn about it later on.
In science community using Python, there's a convention that matrices is presented by
numpy.ndarraydata structure, most of the time. Which is great, but you can't rely on it, you must confirm it by looking at official information sources before using
numpy.ndarrayAPI on these matrices. If you assume that and start coding, then your program may break and you'll be surprised that matrices are presented by a different data structure from a different library.
As you will notice, the term programming interface (without application) is rarely used outside. People say ey - pee - eye everywhere.
It's pretty reasonable, the purpose of every programming interface ever created is to apply a piece of software. If not that then what? From my experience, I just can't point out any case that programming interface created not for applying the software.
So, API ≈ programming interface
To be continued...