Technology Fundamentals
Library
Definition
In computer science, a library is a collection of non-volatile resources used by computer programs, often for software development. These may include pre-written code, subroutines, classes, values or type specifications.
Why It Matters
Libraries are a cornerstone of modern software development, promoting code reuse. Instead of writing code for a common task (like making an HTTP request or handling dates), developers can use a well-tested library.
Contextual Example
jQuery is a classic JavaScript library that simplifies tasks like HTML document traversal, manipulation, and event handling. A developer can use it to add interactivity to a website with just a few lines of code.
Common Misunderstandings
- Your application code calls a library. In contrast, a framework calls your application code (Inversion of Control).
- A library provides specific functions, while an SDK (Software Development Kit) is a broader set of tools that often includes libraries, debuggers, and documentation.