What is a Software Library?
A Software Library is a useful way for computer programs to execute common tasks that other computer programs also execute.
Let’s say you are baking a batch of scones. The recipe for scones refers other recipes, one for the dough and another to make strawberry jam. Those base recipes for dough and jam can be put together in a library of recipes. That library is similar to a software library, in that it offers recipe creators a shortcut to proven instructions for standard parts of their meals.
What makes a Software Library
- A Software library offers a collection of permanent resources that computer programs can access to do common tasks. It’s a convenient way of reusing code that others developed.
- A software library typically includes one or several of the following:
- pre-written code
- templates for messages and classes (classes are an aggregator structure for similar objects)
- example data
Common Types of Libraries
- Static Libraries. These are libraries that will be copied to your computer program and become an integral part of it. Static librarires are incorporated into your program before it is run, at “compile-time”.
- Shared Libraries. These are libraries that can be shared between several programs when they are being executed, typically at “runtime”.
Examples of Libraries
- When you are programming in C languange, you have
libc, the C standard library. It provides functions that help programmers manipulate text (strings), functions for mathematical operations, handling inputs and outputs (for writing into files) and more. The Python language, Java language and most others all have their standard libraries.