Practical software engineering foundations · Lesson 57 of 60 · Concept lesson · Optional
Dependency management
A dependency is code written by someone else that your project uses, such as a library.
A package manager downloads dependencies, and a lock file records the exact versions so everyone gets the same ones.
Each dependency is a trade-off: it saves time but can bring bugs, security problems and updates to keep up with.
Picture it
Code example
function major(version) {
return Number(version.split(".")[0]);
}
console.log(major("2.1.0") === major("2.9.3"));
console.log(major("2.1.0") === major("3.0.0"));Output:
true false
Versions look like major.minor.patch. Within one major number updates should be safe, while a new major number may break your code.
def major(version):
return int(version.split(".")[0])
print(major("2.1.0") == major("2.9.3"))
print(major("2.1.0") == major("3.0.0"))Output:
True False
Versions look like major.minor.patch. Within one major number updates should be safe, while a new major number may break your code.
Check yourself
Pick an answer for each question. You can retry as many times as you like.
Loading the questions…