tags:

views:

145

answers:

5

What is the accepted definition of an API compared to the definition of an SDK? Both seem to be used interchangeably, so I'd imagine that some libraries dubbed APIs are in reality SDKs, and vice versa. Also, is there a reason for this distinction?

Thanks!

+4  A: 

API - Application Programming Interface. This is what you write code to.

SDK - Software Development Kit. These are the libraries that you need so you can code. An SDK likely has many different api's contained in it.

Byron Whitlock
SDK's mayalso contain some support/diagnostic tools, for assisting in immplmenting the API.
David McEwing
SDK's contain: libraries, tools, docs, sample code, etc. It's a kit.
Cheeso
A: 

An API is an Application Programming Interface -- its something your program can talk to. An SDK usually includes an API along with documentation for the API. An API is not required to contain documentation. An SDK may include the API Components, but will always include the documentation.

Nate Bross
A: 

APIs can exist within SDKs but not vice versa. SDKs generally contain a complete specifiction of a framework or environment. For example the Java SDK contains a full specification of the Java language plus tools, external libraries and whatever else the vendor decides to throw in there. The java apis are simply the interface to those specifications.

ennuikiller
+9  A: 

An API, or application programming interface, defines a set of classes, functions, and structures to be used by an application to make use of some library or subsystem. For example, both the windows multimedia subsystem, and windows sockets subsystem both have their own API. An API is not a concrete entity, you can't point at a file and say that the file itself is an API. An API is merely a specification for a communications protocol that a program needs to use to make use of a library or subsystem.

An SDK, or software development kit, contains tools, documentation, and needed files, to program against 1 or more APIs. Some SDKs, but by no means all, may contain sample code to demonstrate how an API can be used. 2 examples of an SDK are the Windows Platform SDK and the .NET Framework SDK.

The most likely reason the terms are used interchangeably is because sometimes an SDK only has the tools, documentation, and files for a single API, and both the API and SDK share the same name. An example of this would be the SDK for developing winamp plugins.

would upvote if I could; out of votes today. this is the best answer so far.
Cheeso
wow, you must have been busy to run out of votes. I've come close, but haven't run out yet.
+3  A: 

None of the answers I've seen so far really capture it clearly and completely.

The two terms are not interchangeable and if someone uses them interchangeably, it indicates a lack of understanding or preciseness.

API - Application Programming Interface. Exposed by a class library. Utilized by an application. When you build an application that uses the library, this is the interface your code uses to connect to or call into the library. In other words the set of rules and conventions applications must follow to use the library. The API includes the classes, their methods, the parameter lists for the methods, and other supporting elements (like enumerations, constants and so on). An API is an abstract artifact: You cannot download an API, or install an API. You can describe an API, and you can use one. The library itself is the concrete realization of the API, the delivery mechanism.

SDK - Software Development Kit. This is a concrete thing. You can download an SDK, install it, store it. An SDK includes:

  • libraries, which, as you know, expose or provide APIs.
  • header files (if applicable)
  • documentation - readme files, help files, release notes, reference documentation, programming guides. Realized as .CHM files, pdf documents, etc.
  • tools - such as compilers, assemblers, linkers, profilers, debuggers, optmizers, test tools, and more.
  • sample code and sample apps - showing how to use the API
  • maybe some other stuff that doesn't fit into one of the above categories


A Concrete Example:

  • the Java SDK is a downloadable, versioned thing. It delivers libraries, tools (on windows: javac.exe, java.exe, jar.exe, etc), all the help files and API doc, and source code for the libraries.
  • the API for Java is the set of rules your code must follow to invoke the libraries; these rules are described in the API documentation.
Cheeso
I loved my answer, but this one is even better, here's an upvote.