After my first contact with a computer in the 1980's, I taught myself to program in BASIC and Z80 assembler. I went on to study Computer Science and have enjoyed a long career in Software Engineering.
Tech Lead/Team Lead. Senior WebDev.
Intermediate Grade on Computer Systems-
High Grade on Web Application Development-
MBA (+Marketing+HHRR).
Studied a bit of law, economics and design
Location
Spain
Education
Higher Level Education Certificate on Web Application Development
Tech Lead/Team Lead. Senior WebDev.
Intermediate Grade on Computer Systems-
High Grade on Web Application Development-
MBA (+Marketing+HHRR).
Studied a bit of law, economics and design
Location
Spain
Education
Higher Level Education Certificate on Web Application Development
You could -at least- perform a google search before posting weird comments like that:
jQuery
jQuery is a fast, small, and feature-rich JavaScript library. It makes things like HTML document traversal and manipulation, event handling, animation, ...
It's still a spurious distinction. Where's the line between a library and a framework?
The best delineation I've heard yet is that a framework is involved in process control, and a library isn't. But then we look at how jQuery was actually supposed to be used, and suddenly it fits that framework definition awfully well.
Tech Lead/Team Lead. Senior WebDev.
Intermediate Grade on Computer Systems-
High Grade on Web Application Development-
MBA (+Marketing+HHRR).
Studied a bit of law, economics and design
Location
Spain
Education
Higher Level Education Certificate on Web Application Development
We have tones of information online, just split what is an opinion and what is not.
As you suggested, a key difference between a library and a framework is "Inversion of Control".
When you call a method from a library, you are in control. But with a framework, the control is inverted: the framework calls you. Both of them define an API for programmers to use.
That's why jQuery, React are libraries while Angular or Vue are frameworks (as examples).
When you are developing an Angular App you create code that Angular will call to proceed.
In React you directly use React methods/functions in order for it to work, otherwise it's plain JS or invalid JS.
Same happen with jQuery, you need to actively call jQuery methods to perform actions.
On the other hand, other key differences are:
A framework tries to provide a complete solution on its environment (check Angular Reference), you'll see animations, a bunch of http-related methods, formatters, internacionalization, factories, forms, SSR...). While a library covers one or a little amount of features (check React Reference) you'll see a little bunch of functions, some of them are just HoFs to bring some extra thingy but related to the same.
After my first contact with a computer in the 1980's, I taught myself to program in BASIC and Z80 assembler. I went on to study Computer Science and have enjoyed a long career in Software Engineering.
What framework I will not use: JQuery
Why: It has served its time. I was excellent for addressing browser/JS variations a few years ago but those day have largely passed - thank goodness.
What would I use as an alternative: Vanilla JS web APIs or any of the other managed FE frameworks.
JQuery is a library not a framework 😅
What a spurious distinction.
You could -at least- perform a google search before posting weird comments like that:
jQuery
jQuery is a fast, small, and feature-rich JavaScript library. It makes things like HTML document traversal and manipulation, event handling, animation, ...
It's still a spurious distinction. Where's the line between a library and a framework?
The best delineation I've heard yet is that a framework is involved in process control, and a library isn't. But then we look at how jQuery was actually supposed to be used, and suddenly it fits that framework definition awfully well.
We have tones of information online, just split what is an opinion and what is not.
As you suggested, a key difference between a library and a framework is "Inversion of Control".
When you call a method from a library, you are in control. But with a framework, the control is inverted: the framework calls you. Both of them define an API for programmers to use.
That's why jQuery, React are libraries while Angular or Vue are frameworks (as examples).
When you are developing an Angular App you create code that Angular will call to proceed.
In React you directly use React methods/functions in order for it to work, otherwise it's plain JS or invalid JS.
Same happen with jQuery, you need to actively call jQuery methods to perform actions.
On the other hand, other key differences are:
A framework tries to provide a complete solution on its environment (check Angular Reference), you'll see animations, a bunch of http-related methods, formatters, internacionalization, factories, forms, SSR...). While a library covers one or a little amount of features (check React Reference) you'll see a little bunch of functions, some of them are just HoFs to bring some extra thingy but related to the same.
You can also check this explanation from freeCodeCamp:
The Difference Between a Framework and a Library.
Have a great day
Joel, I agree JQuery falls more in to the category of library than framework but I did not think the question was really that specific.