IT Glossary
What is a code library?
Code already written and tested by other people, reused inside your application — the standard bricks modern software is built from.
- 6
- sections
- 5
- questions answered
A code library is a collection of pre-written, tested code (functions, classes, modules) that a program calls to do a common job, such as generating a PDF, sending an email or checking a password, instead of writing that code again. Your application stays in control and calls the library code only when it needs it; the library never runs the show. No modern application is written from scratch. For generating PDFs, processing payments, drawing charts or handling logins there are libraries: packages of code written, tested and maintained by others, which developers assemble like standard bricks. An ordinary business application uses, directly and indirectly, hundreds of them, most of them free and open source. For your company this has two faces. The good one: development costs a fraction of what building everything yourself would, and the critical components such as encryption and payment handling are scrutinised by entire communities rather than by one developer working against a deadline. The face that demands hygiene: every library is a dependency. It arrives with its own licence, and some licences carry conditions incompatible with commercial software, and it arrives with its own vulnerabilities. That is why your application needs periodic maintenance to keep those libraries current and safe rather than quietly rotting after handover.
Why it matters for your business
Faster, cheaper development
Standard functionality — PDFs, email, payments, charts — is assembled from mature components instead of being reinvented at your expense.
Quality proven across thousands of projects
A widely used library has been exercised in production by thousands of companies, which means its major faults were found and fixed long before you arrived.
Standardisation that protects you
Code built on well-known libraries can be picked up by any competent team, so you never depend on the unique personal style of the first developer.
Types of code libraries
By origin, there are standard libraries and third-party libraries. A standard library ships with the programming language (Python's os and datetime modules, the C standard library). A third-party library is written by others and added to the project: React for interfaces, NumPy for numerical work, a library for PDFs or email.
By how the code is joined to the program, there are static and dynamic libraries. A static library (.lib on Windows, .a on Linux) is copied into the program when it is built, so the program is self-contained. A dynamic (shared) library (.dll on Windows, .so on Linux, .dylib on macOS) stays a separate file loaded at run time, can serve several programs at once and can be updated without rebuilding them. Microsoft puts it this way: “A DLL is a library that contains code and data that can be used by more than one program at the same time.” The flip side: replacing a shared library can stop a program that depended on the old version (Microsoft calls this DLL conflicts).
How a library gets into an application
Usually through a package manager and its public registry: npm for JavaScript, pip and PyPI for Python, Composer and Packagist for PHP, Maven Central for Java, NuGet for .NET. The project keeps a manifest file (package.json, composer.json, requirements.txt) listing each library and its version.
Each direct library can bring its own dependencies, called transitive dependencies. That is why a project listing a few dozen libraries can install hundreds.
Want an estimate for your project?
Message us on WhatsApp. We reply the same working day, and the first 30-minute call is free.
Library or framework: who calls whom
Martin Fowler (2005): “Inversion of Control is a key part of what makes a framework different to a library. A library is essentially a set of functions that you can call … Each call does some work and returns control to the client.” You call a library; a framework calls your code. React describes itself as “the library for web and native user interfaces”, Django as “the web framework”, and Laravel is the PHP equivalent.
The business consequence: swapping a library is a contained job; swapping a framework is close to a rewrite.
When a library goes wrong: three real cases
left-pad, 22 March 2016: an author unpublished 273 packages from npm, and builds that depended on the tiny left-pad package broke for about 2.5 hours; npm then made unpublishing harder. Log4Shell, CVE-2021-44228, December 2021: in Apache Log4j 2 versions 2.0-beta9 to 2.15.0, an attacker who controls a log message can run code on the server; CVSS score 10.0, the maximum. xz, CVE-2024-3094, March 2024: malicious code planted in the upstream xz release tarballs from version 5.6.0 modified the liblzma library for any software linked to it; CVSS 10.0.
The controls, from OWASP Top 10:2025 A03 “Software Supply Chain Failures”: keep an SBOM (the list of every component, including transitive ones), remove unused dependencies, track versions continuously, watch CVE, NVD and OSV for alerts, and take components only from official sources. The buyer's version: ask your supplier for the dependency list, the update policy and a licence check.
Frequently asked questions
What risks do the libraries in my application bring?
Two main ones: vulnerabilities discovered later, which is why an application is maintained rather than abandoned after delivery, and libraries abandoned by their authors, which have to be replaced in good time. Both are managed through periodic maintenance — a normal running cost of live software.
Do library licences matter for my company?
Yes. MIT and Apache permit commercial use, provided the licence notice is kept. The GPL requires you to share your source when you distribute the software; the AGPL extends that to users of a modified version over a network, so it matters for web apps and SaaS. Ask your supplier for a licence check.
What are examples of code libraries?
React for interfaces in JavaScript, NumPy and pandas for data in Python, Log4j for logging in Java, PHPMailer for email in PHP. On top of these, every programming language ships with its own standard library, available with no extra installation.
Is a library the same as an API?
No. The API is the set of functions a library exposes and documents; the library is the code behind them. A web API is called over the network, while a library runs inside your own program.
What is the difference between a library and a framework?
You call a library when you need it; a framework calls your code and dictates the structure of the whole application. Choosing a framework is an architectural decision that is costly to reverse, while choosing libraries is a daily, contained one.
Let’s talk about your project
Book a free 30-minute call or send us an email. We reply the same working day.
office@northdan.com · +40 750 252 851