layman/terms
How code gets made

Dependency / package

di · pen · den · see

In shortA ready-made piece of code, written by someone else, that your project uses instead of building it from scratch.

You don't grow your own wheat to make a sandwich. Developers don't write everything from scratch either.

To make a sandwich you could grow wheat, mill flour, bake bread, churn butter and boil jam. Or you could buy bread, butter and jam.

In software, those shop-bought ingredients are dependencies. A dependency, or package, is code someone else wrote that your project uses, so you don’t have to build it yourself.

Everyday examples

A typical app uses dozens or even hundreds of them.

Where they come from

Shared online stores called package registries, like npm for JavaScript or PyPI for Python. A tool called a package manager downloads them and keeps track of versions.

What it isn’t

It isn’t cheating. Building on other people’s work is how almost all modern software is made. Most packages are open source and free.

Where the comparison breaks down

Shop-bought jam doesn’t change in the jar. Packages get updated. An update can break your project or, rarely, contain something harmful. That’s why teams check updates before taking them.

How the words fit together

Your code uses dependencies. A library is a kind of dependency. Many are open source.

Watch out

Every dependency is code you didn't write but now rely on. Keep them updated, because old versions are a common way attackers get in.

When you'll hear it

“Install the dependencies.” Download all the ready-made pieces this project needs before running it.

“There's a package for that.” Someone has already written code that does this, so we can just use it.

“A dependency broke our build.” One of the ready-made pieces changed and now our project doesn't work.

Say it in a meeting

“How many outside packages does our product rely on? Who keeps them up to date?”

Try it yourselfReady to use it? The exact commands are on my other site, devcmds: Set up a package manager ↗