This is totally up for debate, so I figured I'd ask.
For further actions, you may consider blocking this person and/or reporting abuse
This is totally up for debate, so I figured I'd ask.
For further actions, you may consider blocking this person and/or reporting abuse
Latest comments (34)
I think HTML is a framework.
This first definition is probably the most accepted one… although a lot of "packages" will fit into both categories. Think Mapbox, Formik or React for example, but even smaller libraries have "slots for your code" at some level.
The question is more: did ever have any real problems mistaking for the other? Did you ever solve anything by distinguishing one from the other? It's not like you're going to mistake react-dropdown for NextJS and it's not like labelling will help you choose between create-react-app and NextJS.
A library is external code that you use to add functionality to your code.
A framework is code that you use by adding your code to it to achieve the desired functionality.
A library is a small toolbox with some code provided to you to achieve small things, like jQuery.
A framework, is a bigger and more structured approach that invites you to follow specific patterns to achieve specific goals.
The difference is not that big of a deal overall IMO.
Library is a pre coded functionality which could be just plugged in and could me made to do it's work. Whereas, framework consists of code upon which developer writes his own code. Framework on its own does nothing sensible but it helps developer to concentrate on logical portion of his code and tries to take the burden off the usual repetitive stuff that is mostly common accros projects.
It's right there in plain English, already. When you use a framework, you are constrained to work within the frame. When you use a library, you are free to choose whatever books you want, and use them how you want.
That might sound like libraries are preferable to frameworks, but the constraints imposed by a framework can be beneficial whereas a library full of books can easily lead to analysis paralysis.
To me a library is plug and play code WHILE a framework is not. If you have a web app you can have a whole lot of libraries but probably only one framework. And libraries you can disable and enable them as you pleases, even replacing one with the other. With frameworks...replacing a framework means rewriting your code base. Hence not a big fan of frameworks at all. Huge proponent of vanilla code.
I believe a framework is something that’s more opinionated in ways we use it.
On the other hand a Library is a helper tool that we can use as per our needs, anytime-anywhere. Libraries are unopinionated and doesn’t enforce a structure to be followed every time, instead it provides a lot flexibility.
Though there are many cases where a Library enforces a particular way of doung things, but that’s mostly just a particular part of it or otherwise an exception.
This is likely not technically accurate, but my mental model is that frameworks give you the foundation to build an application and libraries allow you to use abstractions within a framework. Both invoke you to use their signature, and you invoke it to build your application.
A library is like a tool that can be combined with other tools to create a framework.