In software, what is a 'dependency'?
Options
- A bug that only appears when another bug exists in the code
- Something your code needs to work: a library, package or service (Correct option)
- A very old piece of code that nobody dares to change
- A deployment deadline that is set by the whole team
Answer
Something your code needs in order to work: a library, a package, or another service
Why
If your app uses the library requests to call APIs, then requests is a dependency.
A database or another service your app calls is also a dependency.
Tools such as Maven (Java), pip (Python) and npm (JavaScript) download and manage dependencies for you.
'Dependency injection' is a different but related idea: passing what a class needs from outside.
Remember
Dependency = something you rely on.