Friday, May 27, 2011

javascript programming is not that painful

Before the occurrence of ajax, many developers think javascript is just a toy programming language that can do nothing but only create those annoying popup windows and fancy stuff for a website. I was one of these developers.

The occurrence of ajax and the concept of RIA significantly change developer's mind to javascript. Now they start to accept the fact that javascript is something that you can't offer without having it in web application development. However, most of backend developers still don't like javascript and frontend programming. I was one of these developers.

Actually, the statement that 'backend developers don't like javascript programming' is not accurate. They don't like javascript, but it is NOT javascript's fault. To be more precisely, what they don't like is DOM manipulation. DOM manipulation is painful because it is not consistent on different browsers! It is a consistence issue, an issue about standard. Browsers don't follow same standard. I think that is why some javascript libraries like jQuery become so popular, because they try to make DOM manipulation easier when crossing browsers.

I still don't like DOM manipulation. But, javascript programming without DOM manipulation is just like backend programming that could be very enjoyable, assuming you love programming. I gain this experience by recently developing a game on HTML5 canvas, which i don't have to worry about browsers, as long as they support canvas, the game can run. Again, it is about consistence and standard. Fortunately, this time, browsers follow same standard.

If your frontend application logic is complex(like a game), you will find that all your skills about backend programming and software engineering are useful. OOA/OOP, design patterns, separation of concerns, refactoring, testing, domain modeling, conventions, they all apply.

No comments: