latest tweet: Twice in a two months I have managed to pay 3 times for my hosting package. What an idiot.— 12 hours ago

How JavaScript is quietly taking over the world

Note: This is the first of a few articles that I will be cross-posting from my employer’s blog, where this was originally published earlier this month.

Most people, if they have heard of JavaScript at all, know it as the web scripting language that allows web pages to have nice effects on them - show/hide, fades, ‘accordion’ effects and other animations.

Those with a bit more knowledge on the subject might also be aware that JavaScript can be used to get data from a web server without refreshing the page - a technique dubbed Ajax that enhances many of today’s web-based applications and makes the whole web experience a bit smoother.

But what not many people know is that JavaScript is actually quietly taking over the world.

The fact is that JavaScript, (the standardised version of which is called ECMAScript) which was hurriedly released around 1995, is now more prevalent than you might imagine. And equally importantly, it is cropping up in different places and in forms that people never thought of way back in it’s early years.

The traditional area for JavaScript is on the web, and here it has matters pretty much sewn up in terms of market dominance. Yes, there is Adobe’s Flash, which competes for the web application/ interactivity slice of the pie. However, unlike Flash, JavaScript does not require a plugin, is supported by the W3C, and is considered an integral part of the ‘web standards’ trio of frontend web development languages. And the scripting language that powers much of modern Flash development today, ActionScript, is actually a subset of the ECMAScript standard and is closely related to JavaScript.

All of the major mapping applications such as Google Maps, Yahoo maps etc are powered by JavaScript, as are almost all of Google’s other web offerings, such as Google Mail and Google Docs. Apple’s new MobileMe service gives a desktop application-like interface whose UI is created using a JavaScript framework called SproutCore, and the extremely impressive 280slides.com online presentation-maker application is written in Objective-J, a port of Apple’s Objective C programming language to JavaScript. The growing popularity of these JavaScript frameworks is making the language more accessible to novice developers (although not without bringing their own sets of problems) and removing most of the cross-browser issues that were the bane of developers lives in the early years of it’s implementation.

These applications all make use of client-side JavaScript. However it is now showing up on the server-side (1) as well, with pure solutions such as the Aptana Jaxer project bringing the power of JavaScript to bear on server architecture, creating solutions optimised to today’s heavy use of Ajax in web sites an applications. It’s ‘embeddability’ means that it can also be easily embedded in other server side languages such as PHP (PHP-JS), Java (Rhino), and Perl (JE) amongst many others.

But that’s not ‘taking over the world’ - that’s just taking over the web. Where else does JavaScript feature outside of websites?

Lots of places, as it happens. Still on a web-related theme, Mozilla’s Firefox browser uses JavaScript to power its Graphical User Interface (GUI), and developers can create extensions for the browser using JavaScript. On the desktop, Mac OS X’s dashboard widgets are all powered by JavaScript, as are Microsoft’s Vista Gadgets, Yahoo’s Widgets and Google’s Desktop Gadgets. Adobe released the 1.0 version of AIR, their cross-platform runtime environment for creating desktop applications, in February this year; this allows developers to use web technologies such as HTML and JavaScript to create rich desktop applications.

JavaScript is also showing up as a way for people to add functionality to existing applications, as companies build scripting capability into their products to allow for greater customisation. For example, Adobe’s ever-popular Photoshop application allows users to write scripts in JavaScript, a plugin for Illustrator allows JavaScript to be used to create and manipulate images and tools, and PDFs now support JavaScript scripting and interaction.

This use of JavaScript outside of the web browser looks set to increase - through web development many people already have the skills needed to write the scripts, and it is a language that is well suited to manipulating graphical elements in the interfaces that the modern desktop operating systems provide. There is also a good sense of convergence here: As more and more applications are becoming web based (or at least are offering web-based versions of their desktop software), the desktop is starting to become powered by technology that was born for use in the web.

So it looks like we are going to be seeing a lot more of JavaScript in the coming years, both on and off the web. Not bad for a language that has be derided over the years by ‘real’ programmers, who considered it an ‘amateur’ language because of its unstructured nature and early use to provide whizzy effects for web pages. You’ve come a long way, baby.

——————-

(1) The web is based on a client/server model - there are lots of web servers being run in the ‘cloud’ that process requests from the ‘clients’, the browsers that we use to view the web. Traditionally JavaScript has been run on the client side of this equation, processed by the browser.

Leave a Reply