Programming Libraries: Don't Reinvent the Wheel
Learn what programming libraries are and how to use them. A comparison of static and dynamic (DLL) libraries for beginners.
Programming Libraries
Imagine you are building a house. You don't have to manufacture every brick yourself or design a door lock from scratch - you can buy ready-made, proven components at a hardware store. In the IT world, these components are libraries. They are pre-written code created by others that you can simply plug into your project.
Library
How does it work? Types of Libraries
The way a library connects to your program has a significant impact on how the application runs. We distinguish between two main types, which is key for IT technical exams.
| Cecha | Feature | Static Library |
|---|---|---|
| Extension | .lib (Win) / .a (Linux) | .dll (Win) / .so (Linux) |
| Program Size | Large (code is copied inside) | Small (code remains external) |
| Execution | Standalone .exe file | Requires DLL files in the folder |
| Update | Requires recompilation | Just swap the library file itself |
Common Mistakes and Pitfalls
Missing DLL Files
Version Conflict (DLL Hell)
Example: Including Libraries
Depending on the technology, the usage method is different. See examples for C++ and JavaScript.
#include <iostream>
#include <cmath>
int main() {
// Using the ready-made sqrt function from cmath
double result = sqrt(25.0);
return 0;
}Pro Tips
Use Package Managers
Checklist: How to choose a good library?
Check before using
0/4Quiz: Check your knowledge
Which library type increases the physical size of your .exe file?
Linking Diagram (Mermaid)
What's Next?
- Find out what header files (.h) are and why they are needed in C/C++.
- Test installing packages using the npm install command.
- Check out how UI libraries like React work.
- Read about the difference between a library and a framework.
- Review INF.04 exam papers for questions on using ready-made components.
You might also like
Relational and Logical Operators: How to Compare Data?
Understand how comparison operators work and how to combine conditions using AND, OR, and NOT. Essential knowledge for control statements.
Conditional Operator: Short-hand if-else in one line
Learn the ternary operator. Find out how to shorten your code and when to use it instead of classic if-else statements.
Mathematical Operators: The Foundation of Computing
Learn basic and advanced mathematical operators. Understand how modulo, incrementation works, and why operator precedence matters.