Authored by: Anonymous on Friday, April 20 2012 @ 12:11 PM EDT |
Why a video?
I've seen countless posts on Groklaw, and especially since the trial started and
they started misusing the expression in court that go all the way through
distinguishing the bits of an API Spec, an API implementation, an API
definition, an API declaration and last but by no means least, the use of an
API.
It's getting a bit repetitive TBH.
(one of the best was bug_stompers in response to a request for an example, which
saved me from have to re-do my badly formatted poor attempt that got chopped of:
cf email)[ Reply to This | Parent | # ]
|
|
Authored by: rcsteiner on Friday, April 20 2012 @ 05:30 PM EDT |
An API is simply a description of what is required in order to use a library
function. That includes:
(1) How many elements are required?
(2) What data type do they need to be?
(3) In which order must they be specified?
The library function name is important, and the order and type of the elements
being passed to/from the function are important, but the names of the passed
elements are generally not important. They're placeholders, really.
The above is (generally) true for dozens of languages including C, Fortran,
Java, Algol, Pascal, etc.
---
-Rich Steiner >>>---> Mableton, GA USA
The Theorem Theorem: If If, Then Then.[ Reply to This | Parent | # ]
|
|
Authored by: Anonymous on Saturday, April 21 2012 @ 02:40 AM EDT |
Somebody gives you a blackbox that does something you need: It has some switches
and the instruction manual. In the instruction manual there is a list of all
supported combination of switches with their expected result. This list is
analogous to an API.
[ Reply to This | Parent | # ]
|
|
Authored by: rhdunn on Saturday, April 21 2012 @ 06:53 AM EDT |
An API is a contract between the library writer and the program that uses the
library/API.
Some APIs (e.g. choose the maximum number between two numbers) have simple or
canonical implementations, so the resulting implementation tends to be the
same.
Other APIs (e.g. sorting numbers in an array) can have different
implementations, some of which perform better than others.
When the library is compiled to machine code (for specific platforms) or to byte
code (for a virtual machine) it has a specific ABI (the binary interface
equivalent of an API). This needs to be the same for an alternate implementation
to work with a program that uses the API.
If you look at the Hungarian sorting dances:
http://www.youtube.com/watch?v=ROalU379l3U -- insertion-sort
http://www.youtube.com/watch?v=ywWBy6J5gz8 -- quick sort
http://www.youtube.com/watch?v=CmPA7zE8mx0 -- shell sort
etc.
all of these have the same ABI (they sort a 10 element array of numbers called
a). These could have the API |void sort(int a[10])|. The implementation is
different in each video (algorithm).
The API is what people use in the source code to reference the functionality
they want the program to perform. The ABI is what the computer uses to locate
and run that bit of functionality.[ Reply to This | Parent | # ]
|
|
Authored by: Anonymous on Saturday, April 21 2012 @ 08:48 PM EDT |
"What is an API?"
http://video.agaclip.com/w=CR6XSdt
oh0m ("It's got a button. You click it. It's kinda fun.")
"What is an
API?"
http://www.youtube.com/watch?v
=aps7lvMx0MI
"What is an API"
http://www.youtube.com/watch?v
=iGkTCObcOqM [ Reply to This | Parent | # ]
|
|