[Tutor] api vs library -- a definition

Sean 'Shaleh' Perry shalehperry@attbi.com
Sat, 18 May 2002 13:12:25 -0700 (PDT)


On 18-May-2002 Erik Price wrote:
> 
> True or false:
> 
> An API refers to the rules and guidelines and protocols etc that are set 
> forth by a library.  In other words, a library has an API.  So API is 
> really more of a description of a library, whereas a library is an 
> actual physical chunk of code (well, as physical as code gets).
> 
> I'm probably wrong about this, but if someone could clarify for me and 
> set me right that would make me feel better.  It seems that people are 
> always referring to APIs as though they are physical things, but what 
> they are really referring to is a library of code, right?  (for example, 
> "My company had to purchase an API to handle that problem.")
> 

You have it right.  The easy way to think about this is an API is a
specification and the library is an implementation.  One API can have many,
many implementations.  There is Windows and there is WINE for instance.  Both
implement the Windows GUI APIs.