Library vs Framework
Tags: discuss, beginners, library, framework
Published: 2018-12-14 14:08:12

---
title: Library vs Framework
published: true
description: What are the differences between them?
tags: discuss, beginner, library, framework
---
The other day at the office a colleague approached me and asked me what I thought of Bootstrap. As I been studying Modern Web Development for the past five months he wanted to know whether he should say Bootstrap was a framework or a library. And that question caught me off guard, because I got to know I didn’t understand the differences between a library and a framework.

I am a junior developer, so what I expect from me is to research this to make a proper answer. I am very sure there are other juniors in dev.to that might not know the answer. I will try to tell you what I have learned from this.

### What is a library?
- [Source](https://www.quora.com/What-does-library-mean-in-the-case-of-programming-languages): A library is a set of code that was previously written, that can be called upon when building your own code. It is work that was previously done by someone else that you can now make use of, without having to do it yourself.
- [Source](https://www.webopedia.com/TERM/L/library.html): In programming, a library is a collection of precompiled routines that a program can use. The routines, sometimes called modules, are stored in object format. Libraries are particularly useful for storing frequently used routines because you do not need to explicitly link them to every program that uses them.
- To sum up: A library is a collection of codes you will be using frecuently. You may call the code directly if you need it.
- [Some well known Javascript libraries](https://en.wikipedia.org/wiki/Comparison_of_JavaScript_frameworks): jQuery, D3.js, React.



### What is a Framework?
- [Source](https://www.quora.com/What-is-a-framework-in-programming) To understand frameworks you first need to understand libraries. Libraries are a bunch of codes that can save your time by already implementing the functionality you want. You can call the appropriate library for the appropriate job and the library does the job for you. You don’t need to know how the functions inside the libraries do their job. You just need to know how to call them. Frameworks on the other hand are just like libraries in a way that they make your job easier, but you cannot call frameworks in the same way as libraries. If you want to use framework, you have to learn the framework, because in this case, the framework call your code, and not the other way round. So you need to learn how the framework works and all the concepts inside it. In simple terms, you can call libraries, while frameworks call your code.
- [Source](https://en.wikipedia.org/wiki/JavaScript_framework) A library offers functions to be called by its parent code, whereas a framework defines the entire application design. A developer does not call a framework; instead it is the framework that will call and use the code in some particular way.
- [Source](https://en.wikipedia.org/wiki/Software_framework) A software framework is a universal, reusable software environment that provides particular functionality as part of a larger software platform to facilitate development of software applications, products and solutions. Software frameworks may include support programs, compilers, code libraries, tool sets, and application programming interfaces (APIs) that bring together all the different components to enable development of a project or system.
- To some up: A framework defines how your application will be structured, it decides when to call code and it can include libraries, which will be used if needed. 
- [Some well known Javascript frameworks](https://en.wikipedia.org/wiki/Comparison_of_JavaScript_frameworks): AngularJS, Backbone.js, Vue.js.


### Wrapping up everything
[Source](https://medium.com/datafire-io/libraries-vs-frameworks-626cdde799a7
):If we use the metaphor of architecture, libraries are bricks, and frameworks are, fittingly, the frame.

![Library and Framework](https://i.stack.imgur.com/DqCkT.png)



### So… What is Bootstrap then?
At the [FreeCodeCamp curriculum](https://learn.freecodecamp.org), Bootstrap appears under the “Front End Libraries Certification” section. But in the [official documentation](https://getbootstrap.com/docs/4.0/getting-started/introduction/) says Bootstrap is a framework. I’m clearly not an expert, but if I had to choose I would guide me by the official documentation. Bootstrap is a CSS Framework.


### What do you think?
As I already told you, I am a junior. Is this article correct? Or it has incorrect information?

*Thank you for reading. Don't forget to follow me on dev.to and Twitter!*