Step 55: Make Interfaces Easy to Use Correctly and Hard to Use Incorrectly ~ Scott Meyers
This is the 55th Step towards gaining the Programming Enlightenment series. If you didn’t learn the 54th Step, read it.
What is API?
In computer programming, an API(Application Programming Interface) is a set of subroutine definitions, communication protocols, and tools for building software.
API makes it easier for developers to use certain technologies in building applications. It simplifies by abstracting the underlying implementation and exposing what the developer needs.
An API may be fore web-based system, operating system, database system, computer hardware or software library.
Why design API?
API’s are designed to be used by end users or developers. They must be a pleasure to use and will boost other’s productivity.
What is a good API design?
Good API design must be:
- Easy to use correctly: People use API to solve their problems. The API’s should be designed so that it’s usage has the path of least resistance.
- Hard to use incorrectly: Good API should make it difficult — ideally impossible — to use it incorrectly. API should be flexible to correct the mistakes done by the users, for example, an API might eliminate argument-ordering problems by allowing parameters to be passed in any order.
TL;DR API should be easy to use and hard to use incorrectly.
Go to 54th Step
Go to the 56th Step.
References:
- 97 things Every Programmer Should Know ~ Git Book
- 97 Things Every Programmer Should Know ~ Paperback
- What is an API? ~ Medium
- What is Linker, Compiler, Loader? ~ Stackoverflow
- How Android app is built? ~ github