Differences between a framework and a library.

Chioma Uche
2 min readOct 13, 2022

--

We developers tend to use these two terms interchangeably. What we don’t know is there are prime differences between the two. In this short article, we explain the differences between the two.

What is a framework?

Predominantly, a framework refers to a structure, plan, or system. It could be a structure for anything.

We developers do not always need to start from scratch when building applications; we have tools like frameworks to assist us. A framework is an abstraction in which software, providing generic functionality, can be selectively changed by additional user-written code, thus providing application-specific software.

Frameworks have a few characteristics that distinguish them from libraries:

  1. Inversion of control is a design principle that allows classes to be loosely coupled and, therefore, easier to test and maintain. In a framework, the overall flow is not dictated by the user but by the framework.
  2. A user can extend the framework.
  3. You can extend a framework but not modify its code.

What is a library?

A library is a collection of books. In software engineering, a library is simply a collection of prewritten code used to simplify tasks.

What is the difference between a framework and a library?

Whenever asked this question, I like to explain it with this analogy: A framework is buying an already-built house, and a library is building a house from scratch. The house is constructed already, therefore, you never have to worry about building problems, but you cannot choose how the rooms are arranged.

Other differences include

Differences between Frameworks and Libraries.

I hope this helps you. Please share this to educate others. Feel free to ask questions, I’m here to help.

--

--

Chioma Uche
Chioma Uche

Written by Chioma Uche

20 year old •Software Engineering Student •Full Stack Developer •React •Freelancer •Avid Reader