Title: Libraries and APIs
Course: COP1000: Introduction to Programming > Section: Module Seven

Introduction

In computer science, a library is a collection of nonvolatile resources used by programs on a computer, often to develop software. Libraries contain code and data that provide services to independent programs. This encourages the sharing and changing of code and data in a modular fashion, and eases the distribution of the code and data. Library files are not executable programs. They are either static libraries that are merged with an executable when the executable is being compiled and linked, making them "statically linked", or they are dynamic libraries that are loaded by a dynamic linker while the executable is running, making them "dynamically linked". (http://en.wikipedia.org/wiki/Library_%28computing%29)

An application programming interface (API) is a specification intended to be used as an interface by software components to communicate with each other. An API may include specifications for routines, data structures, object classes, and variables. An API specification can take many forms, including an International Standard such as POSIX, vendor documentation such as the Microsoft Windows API, the libraries of a programming language, e.g. Standard Template Library in C++ or Java API. (http://en.wikipedia.org/wiki/API)

Objectives

Upon completion of this module, the student will be able to:

Define the following: "Libraries" and "Application Programming Interface (API)"
Recognize when to use a library or API
Include a Library in a program

Readings & Resources

Chapter 4: Guess the Number p. 31-32