paint-brush
API is the Gateway drug of Programmingby@vinitagrawal
353 reads
353 reads

API is the Gateway drug of Programming

by Vinit AgrawalJuly 16th, 2017
Read on Terminal Reader
Read this story w/o Javascript
tldt arrow

Too Long; Didn't Read

Like the most common gateway drug:

Company Mentioned

Mention Thumbnail
featured image - API is the Gateway drug of Programming
Vinit Agrawal HackerNoon profile picture

It is the ultimate gateway drug in the world of programming

Like the most common gateway drug:

1. APIs are everywhere and comes in so many different varieties (RapidAPI)

2. It is super easy to use, and gives you the most amazing experiences (UX)

3. You can use it in so many different ways (Web, Mobile, ChatBots)

4. And after using it, you get the munchies (sweet and crispy JSON Data)

OK let me stop with the analogies, and let’s just jump right into it.

1. It is everywhere and comes in so many different varieties (RapidAPI)

From searching for a GIF, to making a MEME

From Ordering Food to giving Feedback on it

From Booking a Flight Ticket to Booking a Hotel

You have all kinds of APIs in the magical world of Web (HTTP(s)) APIs. And they are everywhere. Technically speaking every backend of any application got to have an API exposed to communicate to the front end, but this API may not necessarily be HTTP(s) based.

I would highly suggest you to skim through RapidAPI, which is just a collection of all the amazing APIs that you can use. They list an API called Yoda Speak, which turn your sentences into Yoda-speak!

Pretty cool, that is. Hmmmmmm.

2. It is super easy to use, and gives you the most amazing experiences (UX)

You only have to learn the fundamentals of using the API once, and you open yourself to the whole new world of using the most Amazing APIs out there. It is like outsourcing all the heavy lifting to someone else and you are just asking them to deliver you the end result.

This is You, Once you start to understand APIs

So what are the fundamentals of an API?

Well, I am glad you asked.

Disclaimer: By API I mean REST API. (You know what, Don’t worry about this)

The fundamental is HTTP(s), yes those 4 letters at the start of any web URL. HTTP is a type of P, P means Protocol. Protocol means a set of rules to follow to communicate.

Like If I send following set of emojis to my GirlFriend 🌃 🍌🍑, she will understand that tonight Iam making Banana and peach milkshake for dinner. But if I send this same set of emojis to my Land Lady she might think that I am trying to make Banana and peach yogurt, instead of milkshake.

So the important part of any Protocol is Mutual Understanding.

HTTP(s) Defines such a Mutual Understanding between two people. Those two people are, The Giver (Server) and the Receiver (Client). The most important rule for HTTP(s) is:

The Receiver (Client) will always initiate the conversation by making a request to the Giver (Server) and the Giver (Server) will simply respond to that request and then STFU.

Rest of the rules are just the details about what needs to be sent by The Receiver (Client) so that The Giver (Server) can give what was asked for. Read the Wikipedia page for HTTP, see if you enjoy it.

3. You can use it in so many different ways (Web, Mobile, ChatBots)

You can use the API from a web client (a web app)

From a Native Mobile app (Android, iOS, Windows Phone, Message in a Bottle)

From a Desktop Application (Yes, those things)

From within another API (RecursiveAPIception)

From a ChatBot (#SubtlePlug)

From any piece of code that is connected to the internet

4. You’ll get the munchies (sweet and crispy JSON Data)

Once you understand the fundamentals of it, you start to see the data everywhere. and You develop an appetite for structured data. I like the JSON variety the most, so much so that if the Data comes as something else (like XML or something), I try to cook it and convert it to JSON. so I can digest it easily. Hmm JSOOONNNN…

Conclusion

I think understanding APIs and playing with it using a simple tool like POSTMan, is the most fun way to get into the Tech and Programming. That’s how I started off some 10 years back. The learning curve is gentle and you are exposed to all the amazing things that people are making. I know some of our non-techie customers who started building ChatBots using our API feature and now they are just blown away with all the possibilities and want to learn more about programming.

What do you guys think? Would love to know your thoughts :)