API, stands for application programmable interface. It is an interface, a boundary between external programmable activity and the internal components. Every API has these few definition:
- WHAT is it for
- WHERE should the data flow (One-way, Two-way, into API, out from API)
- WHO should handle the API call
It is applicable at library, framework, and even application levels.
- DO what you say you do
- FOLLOW language- and platform-dependent convention (typographical and grammatical)
- USE clear, specific naming convention
- BE consistent
- MINIMIZE mutability
Characteristic of GOOD API
- Easy to learn
- Easy to use, even without documentation
- Hard to misuse
- Easy to read and maintain code that uses it
- Sufficiently powerful to satisfy requirements
- Easy to extend
- Appropriate to audience