API??

JC0724

Weaksauce
Joined
Oct 11, 2008
Messages
105
What is an API and what programming language would be good to learn to write this?
 
To answer the question more directly an API can be written in any language. An API is the public facing methods/routines/functions/fields/arguments that in application or process that other programs interact with.
 
Here's an analogy..

Imagine you are using a calculator. You use this tool, punch in a formula, and it outputs the result.

In this case you, the human, are similar to the application using an API. The API is the tool, in this case the calculator, that does something you need it to do. The calculator could be implemented in any programming language. The only concern is that you have access to it through the language you are using. It doesn't matter how the calculator is implemented inside, as long as it as buttons that a human can interact with. Therefore, it doesn't matter what language the API is written in, as long as you can use it in the language you writing your application in.

Most of the time people are using APIs written in the same language as the application they are writing. But, it is not uncommon to have a mix and most languages provide a mechanism for interop between different technologies.
 
Aren't apis pre-existng code...? that people make so you don't have to code it yourself?
 
Aren't apis pre-existng code...? that people make so you don't have to code it yourself?

Who do you think codes APIs?

Think about it from the other perspective, say that I have some website that people want to pull data from, then I have to write an API.
 
Pre-existed code is usually called a library. The API is just how you would interact with libraries possibly because you don't own the library or the person who wrote the library wants to restrict how people use it.
 
Pre-existed code is usually called a library. The API is just how you would interact with libraries possibly because you don't own the library or the person who wrote the library wants to restrict how people use it.
These days it's usually meant as a API for a web site or other service - like how you can make a Twitter app for the iPhone and it uses the web-accessible Twitter API instead of screen scraping the site.

You might have to do an HTTP GET request for some tweets and then the API returns (via JSON or something) the Tweets, then it's up to the phone app to make the data appear nice and pretty on the screen. Then you would do an HTTP POST to send a tweet.
 
Back
Top