# Software library

> Ready-made code for a common task that programmers plug into their own programs.

- Level: Intermediate
- Topics: Software
- URL: https://tidbit.legios.com.ar/software-library/
- In Spanish: [Biblioteca de software](https://tidbit.legios.com.ar/es/software-library/)

A **software library** is a package of code written to solve one kind of problem well, so other programmers do not have to solve it again. There are libraries for handling dates and time zones, drawing charts, resizing images, reading spreadsheets, encrypting data or talking to a payment provider. You add the library to your project and call its functions when you need them.

Modern software is mostly assembled this way. A typical app has a small layer of its own code on top of dozens or hundreds of libraries, called its **dependencies**. Each language has a **package manager** that downloads them with one command, like `pip install` for Python or `npm install` for JavaScript, and many of those libraries are open source.

The convenience has a cost. Every dependency is code someone else wrote and maintains, so a bug or a security vulnerability in a popular library can affect thousands of apps at once, and an abandoned one can leave a project stuck. That is why teams keep a list of exact versions, update them regularly and use tools that warn about known problems.

## An analogy

Buying ready-made parts for a piece of furniture: hinges, drawer rails, screws. You still design and build the cabinet, but you do not forge your own hinges.

## Keep in mind

- Reusable code for a specific task, called from your own program.
- Installed with a package manager such as pip or npm.
- Most apps rely on many libraries, known as dependencies.
- A flaw in a popular library can affect many apps at once.

## Go deeper

- [Library (computing) on Wikipedia](https://en.wikipedia.org/wiki/Library_(computing))
- [Python Package Index (PyPI), a public library catalog](https://pypi.org/)

## Related terms

- [Spreadsheet vs database](https://tidbit.legios.com.ar/spreadsheet-vs-database/): Why a company that runs on Excel eventually needs a real database.
- [Python](https://tidbit.legios.com.ar/python/): A popular programming language known for being easy to read and quick to write.
- [JavaScript](https://tidbit.legios.com.ar/javascript/): The programming language that runs inside web pages and makes them interactive.
- [Open source](https://tidbit.legios.com.ar/open-source/): Software whose code anyone can read, use, change and share.
- [Bug](https://tidbit.legios.com.ar/bug/): A mistake in software that makes it behave differently from what was intended.
- [Vulnerability and CVE](https://tidbit.legios.com.ar/vulnerability-and-cve/): A flaw that lets an attacker misuse software, and the public id that names it.
