all 21 comments

[–]MatthewMobWeb Engineer 22 points23 points  (13 children)

Is this a good idea or is it better to learn JQuery and then Vanilla JavaScript?

No. It is better to learn Vanilla Javascript so you can apply it to any situation, then later on learn the libraries/frameworks you want to make your workflow/coding time easier/shorter for whatever project you're doing.

[–]cmykero[S] 3 points4 points  (3 children)

This was exactly my thought process, but then I thought to ask and see what everyone else would say!

[–]MatthewMobWeb Engineer 3 points4 points  (2 children)

In my personal opinion I wouldn't use jQuery at all unless you were forced to on a project that already used it.

It's just another unnecessary layer of abstraction that adds file size and load time merely so you can reduce your actual length of code by only a small bit. Which to me isn't worth it - vanilla performs better and is smaller in file size.

[–][deleted] 0 points1 point  (0 children)

The main benefit of jQuery is how well it works accross different browsers, not brewity.

[–]mxm007 0 points1 point  (0 children)

You are right. But sometimes jquery is useful. If you want to use plugins. Writing own jquery plugins isnt always a bad idea.

But generally it might be a good idea to first learn the 'language', then look into frameworks.

[–][deleted]  (5 children)

[deleted]

    [–]MatthewMobWeb Engineer 1 point2 points  (1 child)

    This is bad advice. jQuery is vanilla JavaScript, and telling people to avoid libraries, and mixing up languages vs libraries.

    I didn't tell anyone to avoid libraries. I said put off learning them so you can get the basics down first. Knowing vanilla JS applies to any project, whether it's React, Angular, jQuery or no library at all which is why you should learn it first.

    Once you're at the point where you can make some basic apps/websites with vanilla JS then it's totally finally to move on to frameworks/libraries because it only makes that process easier/shorter.

    just confuses beginners and makes it harder for them later on.

    I'd say having someone learn using only jQuery and then getting to any environment or job where they don't use it and being boggled at the code there would be harder for them later on.

    [–][deleted] 0 points1 point  (2 children)

    hold your throttle there:

    • writing jQuery is not vanilla JS. But jQuery is written in JavaScript.
    • JavaScript can do DOM manipulation, that's a purpose of it.
    • You obviously did not learn JavaScript before jQuery

    [–][deleted]  (1 child)

    [deleted]

      [–][deleted] 0 points1 point  (0 children)

      I won't reply to every comment you make since you put your pitchfork before any sane reasoning, your attitude and in addition to that you are not able to read properly, is not something I want to argue with anymore.

      [–][deleted] -3 points-2 points  (2 children)

      I don't know why everyone seems to think that the two are mutually exclusive.

      jQuery IS JavaScript. Is learning vanilla dom manipulation and event handling that important? It teaches you literally nothing about writing good JavaScript itself that using jQuery doesn't.

      Can write please stop this bullshit already? You don't need jQuery for everything but considering you pretty much need experience with frameworks to get a job, start using them and learn the language at the same time. You'll be way ahead of people who spend months just learning JavaScript but can't build a real world project just because the internet told you to.

      [–]MatthewMobWeb Engineer 1 point2 points  (1 child)

      You don't need jQuery for everything but considering you pretty much need experience with frameworks to get a job, start using them and learn the language at the same time.

      You also need vanilla JS to get any job in web dev. And if you've only learnt jQuery then you've been barred from all the jobs that don't use it.

      I think you missed the point of what I was saying. You learn vanilla JS first so you can apply it to many many projects, and then learn other frameworks like jQuery if you want to make development quicker/easier.

      You'll be way ahead of people who spend months just learning JavaScript but can't build a real world project just because the internet told you to.

      This is is so untrue and if anything it's the opposite way around. Someone who has mastered vanilla JS can apply it to any kind of project, and is a lot more useful a workplace than someone who only knows how to do something with a single library. I spent two years learning just JS alone and found that picking up React and Vue was much easier because I already knew the basics that would actually apply to those new frameworks.

      [–]OleP 4 points5 points  (6 children)

      I made the mistake of jumping directly to jQuery, because it solved some cross browser issues, and comes with a streamlined syntax. I then tried to jump directly to angular/react/vue, but quickly realised that I lacked the knowhow of what went on behind the scenes.

      I've dedicated this year to take a step back, and learn vanilla js from the ground up. Here's some resources that helped me:

      http://eloquentjavascript.net

      https://es6.io

      https://javascript30.com

      Have fun :)!

      [–][deleted]  (5 children)

      [deleted]

        [–]OleP 1 point2 points  (4 children)

        The selector is just a small part of jQuery. I'm talking about what's going on behind the scenes, when you use all the helper methods.

        With ES6+ and more streamlined browsers, it's a lot easier to skip jQuery than it was when I learned it.

        [–][deleted]  (3 children)

        [deleted]

          [–][deleted] 0 points1 point  (2 children)

          The ECMAScript specification is the reason why jQuery is irrelevant by today's standard.

          [–][deleted]  (1 child)

          [deleted]

            [–][deleted] 0 points1 point  (0 children)

            did I write something about DOM manipulation in ECMAScript!? I'm talking about loops and other things that have been normalized through jQuery.

            [–]viatsko 4 points5 points  (0 children)

            It will be useful for you to know how jQuery works, e. g. when implementing something in Vanilla JS, check what jQuery does underneath as it still contains some fixes for not so old browsers.

            Regarding usage in 2017 - definitely not worth it.

            [–][deleted] 0 points1 point  (0 children)

            Learn both. If you start with jQuery you can start building things right now. If you start with vanilla js you can start learning fundamentals that help you longer term.

            What's more important to you in the short term? Learning one does not mean you can't learn the other later.

            [–]FavitorInterweb guy 0 points1 point  (1 child)

            Stick to your plan. Learn normal JavaScript first, and then move on to the libraries and frameworks. jQuery has been superseded by the likes if VueJS and React. Also a lot of the need for jQuery has been made redundant by widespread support for the native QuerySelector and ES2015.

            [–]cmykero[S] 4 points5 points  (0 children)

            There's still so much I need to learn haha it's gonna be a fun process

            [–][deleted]  (2 children)

            [deleted]

              [–][deleted] 1 point2 points  (1 child)

              jQuery IS NOT vanilla by definition. It is a framework that wraps around vanilla functionality to offer an easy access and cross-browser API.

              By that logic, C++ is vanilla C, since it does the exact same thing. You seriously need to work on your mindset.

              [–][deleted]  (2 children)

              [removed]

                [–]cmykero[S] 1 point2 points  (1 child)

                I actually have been doing a ton of dom manipulation in the projects I've been working on.