DEV Community

Bilal Niaz
Bilal Niaz

Posted on • Updated on

What is different between Framework and Library.

There is confusing between library and framework are same thing or not. yes! there is difference between library and framework. To know the difference between a Library and a Framework, we have to first understand what they are individually.
What is Library :
A library is collection of code which we can use it whenever you need it.
A library performs specific, well-defined operations. internal and external code reuse as the main use case to have a library at all.Facilitates program binding.
Some common examples of Library are:
React is an open-source, front-end JavaScript library.It is use for developing single page application.
Redux is an open-source JavaScript state management library mostly use in React.
jQuery make easier to use JavaScript in our website.
Underscore: Underscore is JavaScript utility library that provides various function for typical programming tasks.
NumPy is a very popular python library for large multi-dimensional array and matrix processing, with the help of a large collection of high-level mathematical functions.
Pandas is a popular Python library for data analysis. It is not directly related to Machine Learning.

What is Framework:
A framework is collection of libraries which make set of rule/regulation,beliefs which we must be follow in our developing software application. **
Ready to use tools,standards and policies for fast application development
Easy to create and deploy an application.
Some common examples of Framework are:
vue is an open-source model–view–viewmodel front end JavaScript framework for building user interfaces and single-page applications.
Angular is a platform and framework for building single-page client applications using HTML and TypeScript. Angular is written in TypeScript. It implements core and optional functionality as a set of TypeScript libraries that you import into your applications.
Laravel is a open-source PHP web framework.which is robust and easy to understand. It follows a model-view-controller design pattern.

Discussion (2)

lexlohr profile image
Alex Lohr

By your definition, react is a framework, too, as it imposes rules (hook rules). Redux is based on the flux pattern and thus imposes a rule of immutability for its state, though I admit this is more of a gray area as react.

Also, your definition of library misses the point of internal and external code reuse as the main use case to have a library at all.

bilalniaz15 profile image
Bilal Niaz Author

You are correct.
Thank you for the update. .