PDA

View Full Version : What's an API?



BigDon
2013-Jan-18, 05:39 AM
That would seem to be a good place to start.

pzkpfw
2013-Jan-18, 06:18 AM
Application Programming Interface

http://en.wikipedia.org/wiki/Application_programming_interface

Jeff Root
2013-Jan-18, 10:43 AM
In computer programming, an API is a subroutine that
is designed to be used by other computer programs.
An API library is a file which contains many APIs.

You have probably seen files with names like JEFF.DLL.
The "DLL" stands for "dynamic link library". It is a library
of APIs. A collection of subroutines that can be accessed
by any program that "knows" the details of how to access
those particular routines. Typically the program will send
one or more values to the API, the API will do something
to those values such as multiply them together, or round
them to the nearest whole number, and then send the
result (or results) back to the program.

-- Jeff, in Minneapolis

Strange
2013-Jan-25, 06:40 PM
In computer programming, an API is a subroutine that
is designed to be used by other computer programs.

Strictly speaking, an API is the set of subroutine/function interfaces.

Ideally, the API is consistent, stable and well documented (ahem). It should also be, as far as possible, independent of the underlying implementation and/or hardware. There may be APIs in multiple languages to the same set of functions.

kaufenpreis
2015-Jan-02, 11:36 AM
API is application program interface.
In easier terms, it is a function,method or procedure(whatever term you like in programming)which can have direct access to routines carried out by operating system (or sometimes in runtime environment like JVM or DotNet CLR)

malaidas
2015-Feb-06, 11:43 AM
the term isn;t actually well defined to be honest. It technically means application programming interface, but in practice what this means is highly varied depending upon the aims of the developer(s). But the essense is that is it a set of programming objects/functions that a 3rd party developer can utilise in their development of a more complex application. For instance the Win32 API is a huge complex set of C functions which provide you access to the various features of windows at a programming level. In contrast you get the Linux API, which is tiny offering only a few services, which are then backed up with a huge variety of shell scripts C programs etc that make up the standard Linux Setup. On the other hand you get something like the flash API which is a proprietary API for the Action Script Language within the IDE of Flash. As I say its very varied depending on context.

In this context it most likely applies to the functions made available for customisation by the framework that Cosmoquest has chosen to use for its forum software.

malaidas
2015-Feb-11, 10:08 AM
As I cannot edit the post as its been there so long I have just noticed something that needs a little clarification regarding the flash API. The key difference here is that technically its basically part of the language, the difference is in how the compiler/interpreter deals with such at a technical level. Whereas the Windows API has nothing to do with the C or C++ language and the same for Linux, the API of flash can be likened to the standard C libraries which differ from C programming keywords in that they are object code written in the C language rather than statements directly interpreted by the compiler into machine code/byte code etc, these are then incorporated into the program by the linker. With Java and other byte compiled languages this final step doesn't happen becuase they keep the individual object files separate but the basics are the same. If you ship a system that compiles etc the language this standard library API must be present.

So as I said API is not a fixed word, the best standard definition is really a framework to support the core programming language in one way or another for specific purposes.

NoChoice
2015-Feb-11, 11:17 AM
So as I said API is not a fixed word, the best standard definition is really a framework to support the core programming language in one way or another for specific purposes.

That is not correct as it stands.
All API means - as others have said - is Application Programming Interface.

It can be a framework to support a programming language but an API can also be language independent.

Many APIs can be used from many different languages.
I routinely use APIs written in C++ in C# without any issue.
If the API is delivered in a DLL (rather than a library to be statically linked) it can indeed be used by any language that is able to use DLLs, which these days is pretty much every language.

There are other forms of APIs as well.
Web APIs are quite common these days. They offer functionality via a web server which can be accessed by web clients (for example you send the postcode and it returns the city). These are commonly accessed via JSON or XML and are entirely programming language independent.

malaidas
2015-Feb-11, 12:35 PM
OK yes, I agree. the problem was the word 'the' in there. I have stated that in my initial post though, this was an addendum to mark the difference between those that are standard for a language and can basically be considered to be part of it and those which are in fact not tied to it directly and yes may offer cross language compatibility.