r/webdev • • Feb 13 '19

Bootstrap 5 will remove jQuery as a dependency

https://github.com/twbs/bootstrap/pull/23586
1.5k Upvotes

398 comments sorted by

View all comments

Show parent comments

49

u/cheekysauce Feb 13 '19

Development in general is moving towards more declarative than imperative frameworks and libraries.

With something like React you're describing what you want rendered, not how to render it. A component is only responsible for the bits it touches, and doesn't affect other parts of the page, and nothing else is going to come along and pull the rug out from under you.

With jQuery you're grabbing random bits of the page and mutating them without a cohesive rhyme or reason. You have to look over the entire code base to understand how the application works. Some other bit of code somewhere could change something out from underneath you and you'll never know about it till it breaks. This is how you end up with spaghetti code.

jQuery was useful in it's day as a nice abstraction over an ugly DOM API, and can be suitable for tiny minor jobs in a single page, but is not fit for purpose for architecting a full application.

16

u/Brachamul Feb 13 '19

Yeah this is a major radin.

For anything simple, vanilla JavaScript works much better than it used to.

For anything mildly complex, VueJS or ReactJS make the app more readable and fixable.

3

u/Grrrucha Feb 13 '19

This makes sense to me since I mostly work with small pieces of code (tags) and I rarely have an opportunity to build something bigger. That's why I haven't seen the downsides