What is a dependency? - Wiki #15

Discover what a dependency is in programming

What is a dependency? - Wiki #15
Generated with Midjourney 6.0

In programming, a dependency is a program needed by another program to function. If the dependency is not installed, the program that needs the dependency does not work, or works in degraded mode.

In Figure 1, the user wants to use program C (thick solid line). Programs A and B (thin dotted line) are dependencies of program C: the user does not use programs A and B directly. It is when using program C that under the hood, program C calls programs A and B to function properly.

Figure 1

In statistics, a dependency usually is an R package or Python library that another package or library needs to function. In R, the tidyverse package has many dependencies, such as dplyr, ggplot2, lubridate and stringr.

It is possible for a dependency to have one or more dependencies of its own. For example, the R package stringr is one of the dependencies of the tidyverse package. And stringr itself has the stringi package as one of its dependencies.

Managing dependencies can sometimes cause problems. Here are a few examples.

  • A large number of dependencies can consume a lot of storage space.
  • If two different programs need the same dependency but in different versions, this can lead to conflicts between versions.
  • Depending on the system, uninstalling a program does not necessarily uninstall its dependencies. Orphaned dependencies, i.e. dependencies that are still installed but no longer used by any program, unnecessarily consume storage space.