JavaScript
Article
By James Hibbard

Editorial: What Do You Want to Learn in 2017?

By James Hibbard

This is the editorial from our latest JavaScript newsletter, you can subscribe here.

Hey everyone, welcome to a brand new year on SitePoint JavaScript. I hope you had a great break (for those of you that took one) and are ready to start off 2017 with a bang.

2016 was a crazy year for JavaScript! We saw an ever increasing adoption of ES6 and the rise of progressive web apps. Also, Yarn emerged as a competitor to npm and JavaScript fatigue fatigue became a thing. In case you missed any of this, or you’d simply like to reminisce on the year just passed, we’ve got you covered. Craig Buckler looks at these events and more in his post JavaScript: 2016 in Review. It’s well worth a read.

Looking forward to 2017 I wonder two things. Will this year be as crazy as the last? And where should I focus my learning efforts in the coming 365 days? The answer to the first question is “almost definitely”, but the answer to the second is somewhat more complicated. Knowing what to learn depends rather a lot on your situation, for example are you looking for a new job? Do you want to become more productive in your current one? Or do you want to check out a couple of new technologies to get a feel for how they stack up against those you already know?

If you’re in that last group, we’ve got you covered there, too. Tim Severien started 2017 by taking a look at three libraries that are worth keeping an eye on in this coming year. I’d encourage you to give that post a read and let Tim know if you agree with his choices (spoiler: one of them is Vue.js).

As for me, I decided that one of my goals for 2017 would be to cut back on my use of jQuery. This isn’t because I’ve suddenly jumped on the anti-jQuery bandwagon. I haven’t. Rather because jQuery was so awesome when it first came on the scene, that today I often use it without thinking. I don’t stop and consider what browsers can do natively.

And actually, this jQuery diet is working out quite well. For example, I recently needed to select an element’s closest parent element, which was an anchor tag. In jQuery that’d be no problem, you’d do $el.closest("a") but in vanilla JS I was unsure. So I hit youmightnotneedjquery.com, entered “closest” as the search term and got back zero results. Hmm … not ideal.

I had a go at putting together my own solution and came up with this:

while (el.parentNode.tagName !== 'A') {
  el = el.parentNode;
}

Which worked, but was kinda ugly. I then googled a bit and found that both Firefox and Chrome implement element.closest() natively. This was all I needed. Job done!

Obviously, replacing jQuery with experimental browser features isn’t an option all the time. If you’re worried about compatibility for older browsers, then using it is a no-brainer. And spending minutes googling what would have taken seconds in jQuery isn’t exactly productive. But even today, websites download many KB of JavaScript, to do what has been part of the standard DOM for years. Incorporating this change into the way I work will force me to become more familiar with what modern browsers are capable of — a worthy goal for 2017.

But what about you? Where will you be concentrating your energies for the next 365 days? Do you intend to learn a new framework (if so which one)? Will you be giving Node a try? Or maybe your goal is to attend a meetup or contribute to open source.

Whatever it is (or isn’t), I’d love to hear about it in the comments below.

  • Ganapathi Vara Prasad

    Thank you SitePoint for the wonderful resources. This year, I want to work on Angular 2 and have some good knowledge on Java 8/9.

  • Iulian Covrig

    ReactJS is my first choice of learning this year, also focusing more on plain javascript to cut of jQuery for good.

    • James Hibbard

      How’s that working out? Did you find anything that was easy to implement in jQuery that was a right pain in the neck to implement in vanilla JS?

  • Peter Mumford

    Your post makes a very good argument for the continued relevance of jQuery.

    • James Hibbard

      Thanks :)

  • But Mozilla clearly mentioned “element.closest()” method is an experimental technology and also it doesn’t support Internet Explorer. Then, how you will support for other browsers?

    PS: BTW, Thanks for your article.

    • James Hibbard

      Exactly. I was working on a Chrome extension, so Internet Explorer / Firefox support was irrelevant. I realize that normally one has to support a wider range of browsers / versions, in which case jQuery is definitely still the best tool for the job.

  • Gilberto Albino

    jQuery consumes bandwidth… SO DOES React, Angular, etc..
    If you are taking your job seriouly, consider paying a CDN on Amazon…
    it’s a shame blame jQuery for its size before its utility.

    JS and DOM themselves are unable to solve the short path jQuery offers for everything it does.
    It will take decades for JS come with the elegant and killing stuff jQuery has today!

Recommended
Sponsors
Get the latest in JavaScript, once a week, for free.