Seeing how you are a beginner, I think you would be better off focusing on building websites with jQuery than diving into the argument. jQuery simplifies things for beginners, and I think your main priority as a new learner should be to build websites, not dive into controversies. So for now, my advice is use it. Build websites with it. As you progress, you will learn more, and then you can dive in and make your own conclusions. For now, I think your focus should be on what can I make - not what is the absolute best way to make something with what disadvantages compared to the advantages of X framework… No. Just build, have fun, and learn - that’s what is important, not what tools you are using.
jQuery is a good starting point because it’s simple and cross-browser compatible, so you can use it to quickly build simple websites while you’re learning. And there’s a good chance you’ll get to use it professionally too - it’s still a very widely used library.
I don’t get the “hate” jQuery has been receiving recently. As if it’s the current hipster thing to do, hate on jQuery for nothing but it’s large library size.
Then same people will be using Bootstrap and it’s advance features,… which is dependent on jquery lib being loaded.
So now we’re back again to native DOM manipulation and writing conditionals for different browsers?
what “hate” are you talking about @owel
But jQuery has several remarkable features on my mind:
The jQuery team knows all about cross-browser issues, and they have written this knowledge into the jQuery library. jQuery will run exactly the same in all major browsers, including Internet Explorer 6!
I’ve run into all sorts of articles, blog posts, forum answers on this.
Try googling jquery sucks, jquery is bad, don’t use jquery, etc
For example, Twitter Bootstrap use jQuery. If jQuery is bad, don’t use Bootstrap either. Yes, it is possible, but do you realize how much code you should wright to do simple things?
Exactly my point. See my post further above.
Oh, agreed; I was merely trying to accentuate it, not disagree with you
Thanks @IsaacAbrahamson for the advice.
Thanks @KeJSaR for this link
So, as you can see Jquery needs less writing wen doing complex things but Jquery is a pretty large file and needs to be parsed.
var $ = document.querySelectorAll;
Now you can select element like in jQuery.
The problem I have with jQuery is that it makes beginners use technology that they don’t know how it works behind.
If you want to grow in a great developer and maybe some day build your own framework or library you need to know how DOM, HTTP Requests, effects and other things really works.
Why is jQuery becoming less popular?
- Browsers have mostly moved past their previous big inconsistencies.
- You might find jQuery is a big file to add to your website if you just need to do thing.
- For small sites, jQuery is fine, but for bigger, more complicated apps, where you will be writing a lot of code, it lacks a guiding structure. This could result in “spaghetti code”. The prevailing practice of the day is to build your web app with smaller, self-contained components rather than one monolithic wall of code.
- Along with components, newer frameworks (React, Vue) are pushing “reactive” models of app design, where the framework updates your DOM automatically if the data changes. While you could build your own reactive system using jQuery, people tend to use it for “event-driven/imperative” design: i.e. “when the user clicks this, app do this.” Reactive design encourages programmers to write “declaratively,” i.e. “the data should display this way; the user clicks this, and the data updates.” The former (imperative), requires the code to think of all the possibilities, and results in more code. Declarative programming tends to result in simpler, cleaner code.
As to valid reasons one might dislike jQuery, it’s slow. For most uses this slowness is a non-issue, but once your app becomes more complicated and performance becomes an issue, jQuery may be part of the problem.
On a side note if you just want the selection engine features of jQuery (ie you won’t be using any jQuery plugins) another option is D3. The newest version of D3 is modular and you use only the parts you need while not having to include the full library. I do a lot of data visualization so I’m already using D3 is most projects, and I usually don’t need to bring in jQuery on top of it.
I guess the whole thing is perspective.
There will never be a lightbulb moment (an ah-ha I get it moment, with this discipline.
Its more like a dimmers witch (gradually over time you’ll be able to see and understand more and more).
Just keep slowly coming back, and hitting it again and again, over and over… go to multiple sources also… many books and many videos.
Remember… its yours if you want it.
Most older projects and experienced developers will use it, and you shouldn’t break from their convention based solely on preference. Overall I would say it’s very much worth learning both.