r/AskProgramming • u/cellwall-999 • Mar 26 '20
APIs Explained ...
I dunno but I don't understand APIs fluently. Does anyone know of an informative article or perhaps a website or just personally explain to me frankly wtf APIs are an why we need them ...
Edit: Thanks everyone for your empathetic contributions. Guess what; I have a better understanding of APIs now than I did before.
53
Upvotes
2
u/socratesTwo Mar 26 '20
The phrase I came up with to help explain it to a coworker is "APIs are sanity checkpoints." Imagine a standard military checkpoint; there's no way around it, and there are lots of men with machine guns. When you pull up to a check point, you interact with the guards they way they want you to interact with them (see previous point about the machine guns). If they want to search your vehicle, it gets searched. If they want you to drive it backwards, you drive it backwards.
So the idea of an API is to codify the policies that you want the guards to enforce on everything going into or out of the cordoned off area.