Results 1 to 9 of 9

Thread: What's an API?

  1. #1
    Join Date
    Jul 2006
    Posts
    11,208

    What's an API?

    That would seem to be a good place to start.
    Time wasted having fun is not time wasted - Lennon
    (John, not the other one.)

    "Hey buddy! My eyes are up here!" - Medusa

  2. #2
    Join Date
    Jan 2005
    Location
    Anzakistan
    Posts
    10,470
    Application Programming Interface

    http://en.wikipedia.org/wiki/Applica...ming_interface
    Measure once, cut twice. Practice makes perfect.
    Yes, Einstein said "It should be possible to explain the laws of physics to a barmaid", and he made some good Gedanken experiments. That doesn't mean one can simply drink a few beers, tell a story that makes 'sense', and go ask for a Nobel prize.

  3. #3
    Join Date
    Dec 2004
    Posts
    14,372
    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
    http://www.FreeMars.org/jeff/

    "I find astronomy very interesting, but I wouldn't if I thought we
    were just going to sit here and look." -- "Van Rijn"

    "The other planets? Well, they just happen to be there, but the
    point of rockets is to explore them!" -- Kai Yeves

  4. #4
    Join Date
    Oct 2009
    Location
    a long way away
    Posts
    9,776
    Quote Originally Posted by Jeff Root View Post
    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.

  5. #5
    Join Date
    Sep 2014
    Posts
    13
    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)
    Last edited by kaufenpreis; 2015-Sep-13 at 09:11 AM.

  6. #6
    Join Date
    Mar 2009
    Location
    Liverpool, UK
    Posts
    4,219
    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.
    Last edited by malaidas; 2015-Feb-06 at 11:45 AM.
    You're really not going to like it, the meaning of life the universe and everything is.... is.... 42!
    What??????
    is that all you have to show for 7.5 million years of work?????
    it was a tricky assignment.

    "Live Long and Prosper" in memory of Leonard Nimoy
    "I think I'll change my name to Cliff. "Cliff, I can't see anyone lasting in this industry with a name like Cliff" in memory of Terry Pratchett

  7. #7
    Join Date
    Mar 2009
    Location
    Liverpool, UK
    Posts
    4,219
    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.
    You're really not going to like it, the meaning of life the universe and everything is.... is.... 42!
    What??????
    is that all you have to show for 7.5 million years of work?????
    it was a tricky assignment.

    "Live Long and Prosper" in memory of Leonard Nimoy
    "I think I'll change my name to Cliff. "Cliff, I can't see anyone lasting in this industry with a name like Cliff" in memory of Terry Pratchett

  8. #8
    Join Date
    Nov 2012
    Posts
    566
    Quote Originally Posted by malaidas View Post
    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.

  9. #9
    Join Date
    Mar 2009
    Location
    Liverpool, UK
    Posts
    4,219
    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.
    Last edited by malaidas; 2015-Feb-11 at 12:37 PM.
    You're really not going to like it, the meaning of life the universe and everything is.... is.... 42!
    What??????
    is that all you have to show for 7.5 million years of work?????
    it was a tricky assignment.

    "Live Long and Prosper" in memory of Leonard Nimoy
    "I think I'll change my name to Cliff. "Cliff, I can't see anyone lasting in this industry with a name like Cliff" in memory of Terry Pratchett

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •