How I stopped worrying and love the JavaScript.

Posted in Uncategorized

If you would've told me ten years ago that I'd be advocating the use of JavaScript for anything other than the teeny tiniest bit of flair, chances are I would've punched you right in the muzzle.

Then again, ten years ago, JavaScript was a Terrible language, absolutely terrible. The current generation of JavaScript in use today is ECMAScript 5.1, which was released in 2011 (Internet Exploder excluded of course, they're still using ECMAScript 3).

While it's true that, in the beginning when JavaScript was first invented, it was designed as a shitty little scripting language (by the name of LiveScript) used to augment browser behaviour for Netscape users. JavaScript started out being an interpreted scripting language, with slow and inefficient interpreters. Today however, this is no longer the case, things have changed.

The JavaScript engine in Google Chrome, the V8 JavaScript Engine, is not an interpreter. V8 is a JavaScript compiler (actually a set of compilers, but that's not important right now).

Google's strategy for speeding up JavaScript was to compile it down to native machine code. And for JavaScript that has been optimized for use with V8, execution is almost as fast as code written in a "real" language such as C. So I'd call V8 a huge success, and it's still getting better. So the excuse of avoiding JavaScript and client side scripting because it's terribly slow and inefficient, is pretty much null and void at this point, it's a moot argument.

What about JavaScript as a language? Is it still a terrible experience to code in it?

Well, yes and no. It has it's fair share of quirks, still, but it has evolved a lot since the '90s. Short answer is, it's gotten better. And it's still getting better. I'm told that ECMAScript 6 is going to further improve the language's syntax, and add some features that are sought after. One can only hope that the adoption of ECMAScript 6 will be sufficiently fast.

Then there's the whole JavaScript eco-system that has evolved in the past few years. It's downright amazing how far it's gotten in a few short years. We have front-end scaffolding utilities such as Yeoman, task runners such as Grunt, and package managers such as Bower. It's gotten to the point where the front-end tooling is matching that of any other area of development.

We've had an increase in speed by several orders of magnitude (not even accounting for Mores law). We have a good set of tools, with more and better tools on the way. we have some amazing looking modern frameworks, such as Meteor. we have unit testing, we have virtually anything you can think of that you'd need to start developing a rich client side application today.

So go download Yeoman (requires Node.js) and start building your client side application today. It comes bundled with Grunt and Bower, so you can take a good look at the multitude of packages already available to you with % bower search.

Don't worry about whether or not JavaScript is fast enough, it is, and will only get faster. Or that it's a language reserved for rank amateurs, it's not, take a look at Gmail.