Too many programming terms - API

in #programming7 years ago (edited)

Hey everyone, sorry for my absence, life has been busy.
Today I want to talk about something really important which are
APIs.

First of all, API, as you might think, is an abbreviation for:

Application Program Interface [1]

While you probably heard a lot already about a series of APIs like the ones facebook, youtube, twitter, and many more offer, you might just not know what exactly it does and the purpose of it.

An API is basically a way of "One developer" offering another developer to use his code.
Let's search for an easier example.

Fritz is growing up fast, and due to his high intelligence (depicted in previous posts), he got his first internship as a coder in a well-known company.

Now, his Boss told him to code a program which gets a user input (text) and then reads it to the user.

Fritz, obviously directly knows what he has to do and he starts recording the whole alphabet.

Fortunately only a bit later a colleague shows up and explains him calmly that he doesn't have to reinvent the wheel and that he should use an API.

Fritz then went to Steemit to my explanation and read it and he arrived at just this paragraph to ... sorry, paradoxon, won't work ...

Anyway, Fritz asked his Colleague then what exactly he means with API which then, in turn, explains him as calmly as before what he has to do.

Now, Fritz packs away the microphone and searches online for an API which translates written text into voice.

And only a little time later, he finds, for example, this here: API

Which in the end only leaves him with the task to find a way to capture the input text, hand the text to the API and receive and play the output.

Which leaves us with the following definition of an API.

Basically, an API is a way how developers enable other developers to reutilize their creations in an easy manner without you having to know anything about how it works internally.

Without APIs, we would have to "reinvent the wheel" every time we write a program and have way more work than necessary.

This is one of the most important basics of programming.
Why should you bother writing code for something someone else has already done and even offers you to use it (often even for free).

It is always smarter to extend on what there is already than doing everything on your own, in the end, you will have more work and you have to bother with a lot of problems your code might have while most APIs have already been tested by tons of users.

So, I hope you can leave this post here with 2 important premises:

a) Before you write something search if there is not someone who has done the same.
b) If you wrote something which others didn't think of yet, why don't you let them use it as an API?

Thanks a lot for reading

Until the next time.

[1] https://www.webopedia.com/TERM/A/API.html

Sort:  

Dunno how many times I've encountered junior developers who have been through a similar situation.

That's probably one of the reasons why Bill Gates said he prefers a lazy developer =D

There is a lot of truth in that statement. Many people who get into programming assume that they will be able to invent the next facebook or google... obviously, that doesn't happen very often. A lazy programmer will sit down and work with what he has without trying to re-implement the internet so to speak.

He will also more probably find the "easier" solutions involving less code to resolve a problem which will result in a less error-prone code.

We have just started the process of writing our own API.
It's for a gaming platform and we need it for game developers that want to have their games on our site.
Lil nervous having never done it before.

I think the most important part of it is the planning since the API should be something that barely changes (at least the interface part of it) so those games don't have to update their integration all too often.

Well that shouldn't be an issue really... The needs of our API tools are extremely specific.
It needs to cause the games to launch on our command and collect score data, that's it.

Yeah, not too much to change around there. I'm on a project which works on a Minecraft modification where we're trying to offer several APIs as well so people can include our mod in their for extra compatibility, so we have to take care to change anything or those mods won't try it anymore in the future =)

Maybe you'd be interested in helping if we get into a jam?

Sure, If you run into problems feel free to contact me, I'm happy to contribute with my view.

Really great breakdown :) Keep it up

Coin Marketplace

STEEM 0.18
TRX 0.16
JST 0.030
BTC 66852.45
ETH 2597.81
USDT 1.00
SBD 2.66