Life is too short to learn JavaScript, focus on jQuery and play an instrument

23 Jan

Last week I read an interesting post called Hiring Front-End Engineers, in this article Chris Zacharias talks about his experience on hiring Front-End Engineers for Youtube. Basically he’s saying how hard it is to find good professionals for this position. One of the reasons is that good Front-End developers must know JavaScript, not only jQuery.

Well, that made me think about what kind of skills should I focus on for my career. I would say that I’m a advanced JavaScript programmer, but I also can say that since I’ve been working with jQuery so much, I’m becoming an advanced jQuery programmer. And my question is: is that good or bad?

And the answer of course is: depends. Mostly depends on the needs of the project you are working on. In my experience I only have been requested to have really good knowledge on JavaScript once.

My JavaScript challenge

When I worked for Adesis, the main project was the new version of the online banking application for Caja Madrid. For that project we had a huge library of JS built on top of Prototype.

So basically a good knowledge of Prototype would be enough for this project right? Well, that’s wrong. My biggest JS development was a “plugin” to control dependencies over questions and group of questions of a form, and all of those questions and dependencies were dynamic. The challenge was awesome.

After some good days of work I had around 400 lines of JS and 60 unit tests to validate that. It was all working great, until I had the idea to put a profile to see how long it takes for it to parse the dependencies and show, hide the questions and its dependencies.

The result was 3 seconds on Firefox and about 11 seconds on IE6! And of course that was totally unacceptable. That’s where my knowledge of Prototype was useless, if I wasn’t able to understand what was going on behind the scenes I would never be able to reduce the loading time.

I don’t want to stick to the details because this article is not about JS optimization. But after changing some selectors, trying to work more with ids than with classes and much more, the result was: 300ms on FireFox and 900ms on IE6. And that was acceptable.

I wouldn’t be able to resolve this issue if I didn’t have a good JS knowledge, if I didn’t know what was going behind Prototype. I’m not saying I know everything Prototype or jQuery does behind the scenes, but you can know, for an example, that a class selector is slower than an ID selector.

The conclusion

If you’re a designer and your JS needs are collapsing sections on click, or creating a simple slideshow: Focus on jQuery and learn how to play an instrument in your free time!

Now if you consider yourself a Front-End Engineer, forget about playing an instrument and learn some good and clean JavaScript, I guarantee you it will be useful. But careful not to reinvent the wheel, take advantage on the good frameworks like Prototype or jQuery, they can give maybe enough time to learn how to play the Maracas.