Industry insights

You don’t know JavaScript

You don’t know JavaScript

JavaScript will not be ignored. The awkward adolescent of yesteryear has come of age; confident, capable and crashing your party. Much to the disdain of your “formal” friends (like the C#/Java clique) it embraces a low ceremony approach to getting stuff done. JavaScript is cross platform like no other language, not constraining its ubiquity to any given technology stack or even paradigm. Once chained to the browser, relegated to animation and Ajax, the introduction of Google’s V8 JavaScript engine for Chrome set a course of action that broke JavaScript’s angle-bracket shackles letting it loose upon the world. JavaScript can be found on the server, database, and embedded devices – above and beyond still ruling the browser.

While JavaScript has been an essential part of web development since September 1995, it was only 13 years later that Google developed and introduced their V8 JavaScript engine, recognising that JavaScript was bursting at the seams of browser performance, and seeing the need for it to grow. This decision was a catalyst for what followed, with the NodeJs project releasing a retooled, server-side JavaScript framework reliant on V8 less than 8 months later followed by a avalanche of rich-client JavaScript frameworks all climbing onto the HTML5 train. With this in full roar, it is at times difficult to separate the signal from the noise, and figure out where the hype begins and ends. JavaScript itself has not remained stationary during this time; the ECMAScript specification has trundled along, albeit at a sedentary pace, and the W3C is constantly including more APIs that are accessible to JavaScript, such as local storage, audio, video, hardware, web sockets.

Between the auto-include jQuery library and the almost flavour-of-the-week proliferation of SPA / MV* frameworks (AngularJs, Ember, KnockoutJs, Backbone, BreezeJs) you can barely turn around on the web without running into a richly-interactive application built using the ‘next big thing’. The largest technology companies are all relying on JavaScript heavy web applications to drive their ‘next generation’ user experiences, and the enterprise is following suit. Demand has risen sharply for rich and responsive user interfaces that have a high reach and a very small footprint, moving away from traditional desktop applications and taking business into the cloud. The choice of framework is still a contentious issue, and the variety of these client-side JavaScript frameworks only serves to make the decision harder. While the client side landscape is inundated with choices, it is the *nix-like, single purpose nature of most JavaScript libraries, allowing them to be used as composable building blocks, that makes the platform a pleasure to develop for. If you need complex time manipulation: use MomentJs. Need OAUTH? Use PassportJs. Need backwards compatibility with IE? Use modernizr. The options are endless, and result in JavaScript being a build-your-own-framework platform, where you choose what you need and only what you need.

As with any coming of age, it is important to have boundaries and rules, and JavaScript is no exception. The world has woken up and realised that the Web is no longer the wild west of the 90’s, and to write complex and scalable applications in JavaScript is going to take discipline.

Alongside the hype of new frameworks is the steadily solidifying base of emergent JavaScript design patterns, many of which are direct extensions of the traditional ‘Gang of Four’ patterns. It is also essential that one identifies ones weaknesses, and there are many object-oriented concepts and practices that can have no real analogy in JavaScript. Rather than condemning the language, a myriad of projects have evolved like, CoffeeScript, TypeScript, Dart and Google Web Toolkit to create specialised languages that compile to JavaScript; leading to it being the ‘assembly language’ of the web.

JavaScript has a long track record, and many major players on the open web already rely on it heavily. Even its more experimental forms, being server and database bound, are met with great success. Yahoo, Paypal, Ebay and Microsoft Azure are among those that rely heavily on NodeJs for critical systems, and Forbes, IBM and CERN are amongst those using MongoDb for ‘big data’ – all taking the leap and reaping the rewards. Full stack JavaScript has empowered some of the biggest web companies to not only rapidly prototype, but improve programmer productivity and performance. Paypal, for example, rewrote their Checkout functionality using full stack JavaScript and reports hyperbolic success. While there is no such thing as a silver bullet in software enterprise is starting to recognize that what works on the open web can work for it.

Playing on the server is still an away game for JavaScript though, and it’s on its home ground, the browser, that it dominates. The fervour of the HTML5 movement is driven by the engine of JavaScript, not by the addition of a couple of semantic HTML tags. As much as the W3C has done for the acceptance of HTML5, it is the continued excellence of client-side JavaScript frameworks that drive its meteoric rise. JavaScript has moved from being an ‘ancillary’ skill set on a developer’s CV to being a core concern. Being versed in purely a server-side language is no longer good enough.

So everything needs to be rewritten as JavaScript, right? Wrong. Conventional software stacks are by no means being obviated, and varied skills in these technologies are more relevant than ever. The Java virtual machine and .NET framework still have much more stability and straight-line speed than NodeJs, and their operationalisation is something that is well understood. JavaScript plays well with others and can augment existing software stacks where it fits the problem, but it takes a keen eye to determine when it is the right solution.

Whether on the client or server, used judicially, JavaScript can bring a modernising element to a software solution, elevating it from simply another line-of-business application to something that stands out. JavaScript will not be ignored and will continue to grow, and right now it’s kicking down the door of the enterprise.

What’s next? We’re ready!