Monday, October 12, 2015

The Practice of "Vanilla JS"


I try to keep my skills up and its hard to do when the thing you try to have skills in is always changing. The web landscape is always in flux, at a seemingly ever-increasing pace. Javascript represents only one area of the web, and as a language within a much greater ecosystem even that microcosm can keep you busy with the evolution of the language itself (ES6), constantly rolling out new in-browser APIs (like the new Web Cryptography API), and learning to sling this language both inside browsers and on backends (Node.js).

One of the best tools I have to keep these skills sharp is the practice of what you call “Vanilla Javascript”. I try hard to find lots of small opportunities to practice Javascript without the abstractions of all the myriad of libraries and frameworks that might obscure it even in the course of a single day’s work. I find two simple strategies help me poke through the cushion these tools provide to make sure I don’t forget what’s under the hood.

  • On a new project, especially a smaller one, I’ll build what I can using no JS libraries until the need really presents itself. Its wonderful how many tasks you’d turn to jQuery in the past for are just fine to approach using nothing but standard APIs today.
  • At any time, I try to have one toy project i might come back to when I have some time to kill, which I keep a “plain only” rule on. These are just private throwaway projects, but useful to give me a sandbox to avoid the pressures that usual projects bring to the table with a necessity of a toolchain’s safety net.

The effort is small, but the impact of keeping yourself reminded of the language and APIs underneath jQuery, Angular, React, or whatever other JS toolset you prefer is undoubtedly valuable. 

The next time you’ve got a new task JS to complete, give yourself a quick challenge in accomplishing it without a library. But, find a balance, and don’t force yourself to do what you really should use a library for. Just give yourself that chance, now and then, to discover some new Vanilla JS you may have not known before or to revive some understand which had gotten rusty.

No comments:

I write here about programming, how to program better, things I think are neat and are related to programming. I might write other things at my personal website.

I am happily employed by the excellent Caktus Group, located in beautiful and friendly Carrboro, NC, where I work with Python, Django, and Javascript.

Blog Archive