JavaScript inherits the earth
Written by Ian Elliot   
Friday, 29 April 2011 08:57
Article Index
JavaScript inherits the earth
The penalty of language swapping

Forget Java killers, JavaScript is about to ensure the mass extinction of every other programming language on the planet. This isn't a mass extinction by design or disaster - it is simple negligence.

 

We seem to be sleepwalking into an event of huge importance. We are about to promote JavaScript into the most important computer language ever.

Yes that's right - JavaScript.

JavaScript is set to become the single most used language in the near future simply because of the HTML5 bandwagon and the enthusiasm we seem to have for web apps. You may argue about the next Java killer, but I can tell you now it is JavaScript.

You may think that Scala is an elegant language, you may even yearn for the days of Lisp or Fortran but they are all, both the new and the old, dead meat.

We are handing the keys to the empire over to JavaScript - it is as simple as that.

OK you may not like it and you may want to take issue with me, but wrapped up in the assumption that Web 3 is all about HTML5 is the deduction that the language of client side coding is going to be JavaScript.

The reasons are obvious. JavaScript is the only language supported on standard browsers and you cannot expect the end user to have a browser that supports anything else. Rather than implement a virtual machine approach to browser language implementation, we have adopted a single language for all approach.

Why?

I can't be sure and neither can you but it seems that in the case of the web the tail is still wagging the dog.

What color would you like your web app?

Despite the fact that the revolution of Web 2 was about  dynamic web applications and databased websites, what are we concentrating on? Semantic markup and making things look pretty using CSS. All of the headline news is about how HTML5 is going to bring about the new revolution amounts to prettier typography and multi-column layouts. For some reason the revolution seems to be hung up on what things look like not on how they behave. Even semantic markup leaves everything to be desired in that you might well use it but we have little idea what to do with it next.

OK - so HTML5 is good, CSS3 is good but where is the push to make programming the thing better? We have JavaScript and to make life a little more interesting we have some new sub-systems - Canvas, Websockets, web helpers and even WebGL if Microsoft ever manages to see that standards are a good thing.

All good but... where is the "big push" for programming language support?

Why is it we can focus on what color the web app is but never ask how best to code it or what is needed to get the more difficult job done.

Where we are

I'm not going to bore you with the fine details of why JavaScript stagnated but it is worth figuring out where we are today.

JavaScript was the first scripting language to be supported by browsers and it has never lost that lead. It has been standardised as ECMAScript but most still call it JavaScript. It has been through three major revisions but version 3 (JavaScript 1.8) is more or less the version you meet in the real world today  and it was completed in 1999 - which makes it ten years old. Version 4 was supposed to make it into the real world but basically it all fell apart because no one could agree on what should be in the language or out of the language.

Now we have ECMAScript 5, which is at long last working its way into browsers that people actually use. This said, the changes to create ECMAScript 5 are welcome but small and we will probably be writing ECMAScript 3 for some time to come as we wait for older browsers to die away.

The issue really isn't just the core JavaScript language either. Why for example has the DOM long been regarded as a second class citizen? OK, you may want to maintain that JavaScript is a pure language that runs anywhere but in most cases the interaction of JavaScript with the DOM is vital to the way applications work .

Equally you can pretend that the DOM is something separate from JavaScript but what other language makes as much use of it? If we are serious about making JavaScript our number one language we should recognise the DOM as being its fundamental framework and make DOM objects full JavaScript objects.

Server Side and  client side

So you still don't like the conclusion that JavaScript is about to rule the planet - especially so when you realise how little effective effort has been put into improving it. 

You might try consoling your self with the thought that JavaScript is client side and this means that its important will be well fenced in. You can still continue to use your favourite server side language and ignore JavaScript. You might even stretch this point to include out of browser applications on the client side. So .NET, Java, Ruby, Python, PHP etc.. they all have their niches either server side or where no sensible browser would venture.

Well think again - JavaScript is coming.

As JavaScript becomes even more important than it is there is no way that you are going to ring fence its use into "client side".

Just look at what is happening at the moment with NodeJS which lets you work perfectly happily on the server side. Notice that NodeJS in itself isn't particularly innovative, other languages have also used an event driven I/O approach to web services. NodeJS just happens to work with JavaScript, which programmers who know the language prefer. The CommonJS project is working hard to produce an environment for JavaScript outside of the browser and this extends its reach not only to server side apps but to client side, out-of-browser apps.



Last Updated ( Saturday, 30 April 2011 17:52 )
 
 

   
Banner
RSS feed of all content
I Programmer - full contents
Copyright © 2013 i-programmer.info. All Rights Reserved.
Joomla! is Free Software released under the GNU/GPL License.