JavaScript pain and love

This is a common story how a developer moves from hating to loving JavaScript. In fact, after reading around in the developer world (especially the .NET world) a common path is:

  • Stage one: when a developer approaches DHTML for the first time, he thinks "what a newbie language! It's totally useless, because thanks to a postback I can manage the UI interactions made by the user"

  • Stage two: when a developer meets HTML and jQuery, he thought "jQuery is powerful but it's a shame that it is based on JavaScript, I can't understand what happens when: I cling to the backend development and I leave jQuery to a junior developer"

  • Stage three: when a developer hits on the book JavaScript The Goods Parts, it exclaims with remorse "Please JavaScript, forgive me for all the time I condemned you: I hadn't seen the light yet!"

Sometimes the last stage is a bit more complicated, especially if you have a solid object oriented background. When you start to feel the JavaScript potential, the first approach following by you is to try to apply to JavaScript the same languages paradigms you are used to, such as classes, inheritance...

In the football context, it's like you try to beat FC Barcelona playing 'Tiki-taka': unfortunately Iniesta, Xavi and Messi belong to the opponent's team.
So, my suggestion is the following: you have to come back to the earth and forget things like dependency injection, Linq, Visual Studio, reflection and generics (replace that with the features of any of your favorite languages and tools): if you think that you can develop in JavaScript in the same way you do in C# or Java (or any other language of your preference), a walloping is wating for you.

What's the best approch?

I continue with the football analogy. You have to take advantage of your skills like Chelsea did in the semi-final of the 2012 Champions league: a solid, compact defense and counterattack.

For all the languages you learn, you must capitalize features and paradims of the language and avoid trying to bend it to your habits. So, for JavaScript embrace its simplicity, productivity and goods parts avoid its bad parts.

comments powered by Disqus