Becoming a better JS developer

Things I made sure I really actually know.

Roie Schwaber-Cohen
3 min readSep 22, 2013

I am going over everything I thought I knew about Javascript, and I made a list of things I thought are important for any JS developer to know. I started by watching Douglas Crockford’s lecture series on Javascript. I highly recommend it, it blew my mind.

Prototypal inheritance

Maybe the strongest feature of Javascript — it takes away the need for sluggish classical inheritance patterns. I think that’s where Javascript really shines — you get to write what you mean, which is wonderful.

Closures

Closures are just a fancy name for something Javascript developers “know” intuitively. But a lot of them don’t really know it. In short, it’s what happens when you have a function within a function — the inner function could see the variables in the scope of the outer function.

Scoping / context

Once you figure out how (and why) closures work, your can now properly scope your application. Learn about the Module pattern and how you can use prototypical inheritance and closures to build modules.

Design patterns

It’s super important to know the basic design patterns, like the Factory, Singleton and Module patterns. But knowing some more could really open your mind. Javascript Design Patterns is an awesome book to go over these.

Unit testing

You gotta test your code. Writing untestable code is silly in the long run. I admit I don’t write enough tests, and I’m on the fence about TDD, but there’s no doubting tests are crucial to any scalable development operation.

Ajax and JSONP

Ajax is what makes the web work. Without it, our pages would be sad islands of static data. Since most people don’t really go into it, they can’t really understand some funky stuff that ajax does when it isn’t implemented properly. Learn what JSONP is and how to handle cross-domain requests.

MVC or MVVM

You have to understand how this design pattern works if you want to live in the modern web development world. It just make sense, and once you get the hang of it, it makes your life easier. Thinking MVC really makes the separation of concerns an inherent part of your code.

Event bubbling

Understand how events are triggered in Javascript. In short, event bubbling means the browser starts an event from the last child element in the DOM tree, and then it bounces up the tree.

Regex

Regex is a bummer (to me), but it’s part of life, and super powerful. It’s really efficient when you’re looking for text patterns, and you can do a lot of “heavy lifting” text analysis with just plain Regex.

Cross-browser issues

If you learn a bit more about the origins of Javascript, you’ll be able to make some educated guesses when you hit issues with IE or any of the other lesser browsers. Play around with it, and write some simple apps to see what’s different and what stays the same.

The DOM

Understanding that the DOM and Javascript are two separate things is crucial. The DOM is horrible, Javascript is awesome. It’s that simple.

Memoization/Caching

Memoization is a way to cache data and only request for it when it’s not there. I found it amazingly useful in a lot of practical scenarios I encountered. Here’s a great useful article about it.

Dev Tools

Know your devs tools. Chrome has by far the most amazing dev tools I have ever seen. I found a lot of talks about Chrome Dev tools, I liked this one the most.

--

--