DEV Community

Discussion on: What is the ONE language/framework you refuse to use? But...WHY???

Collapse
 
tracygjg profile image
Tracy Gilmore

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.

Collapse
 
joelbonetr profile image
JoelBonetR 🥇

JQuery is a library not a framework 😅

Collapse
 
dominikbraun profile image
DB

What a spurious distinction.

Thread Thread
 
joelbonetr profile image
JoelBonetR 🥇

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, ...

Thread Thread
 
fjones profile image
FJones

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.

Thread Thread
 
joelbonetr profile image
JoelBonetR 🥇 • Edited

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

Collapse
 
tracygjg profile image
Tracy Gilmore

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.