Javascript is a well known programming language for web programmers and/or web designers in the world. As a scripting language embedded in browser, Javascript play many times as a fixation to browser rendering, create a fancy animations, and lately, to gather data asynchronously to the famous term called as ajax.
There had been a time where Javascript hated, as becoming the most misunderstood programming language. I remember that day, many of my friends didn’t want to use or even avoiding to use Javascript or their works on Web Application developments.
That days, the implementation of Javascript was a great pain in the ass, just to make the code running well in most common used browser which is Microsoft Internet Explorer (I’m still sure IE kinda contribute to the hell that programmers suffered that days).
To behated, doesn’t make Javascript being left behind. The fact that Javascript is being the only implementation of browser scripting language (or more appropriate to call it as the spesification itself), and the lack of browser ability to fulfill what people hunger of rich internet has made Javascript unavoided. Several Javascript toolkits and libraries fill the market and success, such as, JQuery, Prototype, Dojo, ExtJS, etc.
When a friend told me about Node.js. My natural defense told me that, I guess it is just another Javascript toolkit or library. But I was wrong. Node.js is not a library nor toolkit for browser.
Node.js is a platform built on Google V8 Javascript engine. It can be run without the browser. You can make a js script and run it from your terminal.
The true power of Node.js is it brings the beauty of Javascript (or the most misunderstood) to servers. Asynchronous callback, single threaded, evented I/O promising servers to serve requests better for massive concurrency.
After several days played around with node.js (and produce node-arch and node-iso8583, see my github), at first it is hard to adjust my behavior to code in common synchronous way, to the way node.js work in asynchronous and closure manner. And suddenly my codes grow to become complex enough not to read
.
That’s why I start refactoring my code and implementing common best practice to code in Javascript I’ve learnt by googling.
If you love Javascript while others hate it. Or you looking for alternative solution for your application performance. Or you are to paranoid to massive slow down by hung by threads. Or you simply always think as a lazy person, “just ask and call me back if my request done”. You should check Node.js.
And if you need help. I and my company at http://xinix.co.id surely can help you with our best practices.
0 Comments.