What's an Application Programming Interface? The Answer Might Not Be What You Think

in coding •  7 years ago 

First of all, what the hell is an API? Well, some of you might be aware that API stands for Application Programming Interface. You probably already know that an application is a piece of software like a word processor (Microsoft Word, Abi Word, etc.) that does a specific task or set of tasks. Application Programming tells us that we're dealing with something that helps us to program applications.

But it's this last word, interface, where I think people start to get lost. I was much the same until recently (i.e. yesterday and this morning). When you hear interface, you probably automatically think something visual, like the GUI or graphical user interface. But as it turns out, interfaces are so much more.

Imagine that you wanted to build something, say a house or, better yet, a computer. Well, without any outside assistance you could basically look forward to making the cement, bricks, refining the ore from metal into steal which you would then have to forge into pipes and on the computer end creating microchips and various cards from scratch.

We're talking about a process that might take years longer, if not an entire lifetime.

Fortunately, that's not how humans build things. We get to search through a library of parts like a hardware store or a tech store in order to find the pre-built pieces we need to build whatever we like. This saves us an inconceivable amount of time and effort.

Well, those pre-made bricks, pipes, graphics cards, and CPU's can also be thought of as types of interfaces. You don't need to know the mechanism by which the CPU works nor the method by which the pipe was manufactured in order to make use of them in building what you want to build. Some interfaces are visual or direct, like a light switch. Other are hidden, like the pipe. It depends on the library

Application Programming Interfaces are similar. They are basically libraries of software 'parts' that you can use to build different kinds of applications. These parts, much like our examples, would be a real fucking hassle to build ourselves, so modern programming has grown to rely heavily on these libraries.

Another thing to understand about application programming interfaces is that they allow you to interact with software in such a way that you can tell it what to do, but not how to do it. This is a subtle but important point. In other words, the internal portions of interfaces is inherently hidden from the rest of the program, which is super important in modern programming because it makes programs more manageable, bugs easier to detect, and software more secure.

Think of a car. Once you know how to drive one car you know how to drive them all, even though their internal mechanisms might be significantly different.

Follow: @jenkinrocket

Thursday, November 9th, 2017

Source: 1

Authors get paid when people like you upvote their post.
If you enjoyed what you read here, create your account today and start earning FREE STEEM!