This content originally appeared on DEV Community 👩💻👨💻 and was authored by Partha Maity
Library
You started a project and finished it and then started an other one and noticed 🤨 that you have repeated some pieces of code from previous project and then you finished it.
Next day, you started a new project and damn! you noticed it again, you once again repeated some pieces of code from previous two projects.
Hmmm!! 🤔 ...
So you thought - "Why not I copy those repeating pieces of code and keep it in a separate file, so that the next time I need it, I can just copy it from there."
That's how the concept of library came into existence.
A library is a collection of reusable pieces of code that can be used in multiple projects.
Framework
Once fine day, you started a project and you noticed that you have to repeat some pieces of code from previous projects. You grabbed your library and copied those pieces of code and probably felt happy 😄 that you have saved some time.
But soon that happiness turned into frustration 😤 when you received handful of bugs 🐛 from the application. You started debugging and realized that you have to fix the same bug in multiple places 😫. You fixed it and moved on.
For the next few days, you kept on receiving bugs 🐛 and fixing them.
....and then one day, you realized that if you had followed a particular structure or pattern, you would have saved yourself from all these bugs 🐛. You made few rules from your experience and started following them.
You noticed that you were able to fix bugs 🐛 faster and also were able to add new features faster. It just boosted tour productivity of building applications.
You just created your own framework.
A framework is a collection of rules and guidelines or a structure for building an application.
Note: The above explanation is just for understanding purpose. It is not a complete explanation of library and framework. If you find any mistake in the above explanation, please let me know. I will be happy to correct it.
This content originally appeared on DEV Community 👩💻👨💻 and was authored by Partha Maity
Partha Maity | Sciencx (2022-11-23T14:27:33+00:00) Library vs Framework Explained. Retrieved from https://www.scien.cx/2022/11/23/library-vs-framework-explained/
Please log in to upload a file.
There are no updates yet.
Click the Upload button above to add an update.