Thursday, 19 January 2012

The JavaScript Story

Over the past 6 months I have been doing something that even a year ago I wouldn't have dreamed off - coding in JavaScript!

When I started I very naively assumed it was a sort of "Java for Web Pages", complete with the full complement of built-in support for encapsulation, inheritance and polymorphism, so it has been a bit of a shock to discover how limited the core JavaScript capabilities are, as well as being pretty weird from the point of view of somebody like me coming from a C/C++/C# background.

Despite that I have made some good progress using JS for its traditional purpose of manipulating the DOM, and also in AJAX. The next step, of course, is to use JS for more ambitious applications with the type of functionality found in desktop applications. This is where the limitations of JavaScript start to kick in and make life difficult. There are numerous workarounds to emulate interfaces, inheritance etc., but they are just that - workarounds. Of course you can write a library of use a ready-made one to provide such functionality but, however you do it, you are still using very fragile and inefficient extra code to simulate the capabilities provided as a core part of other languages. A lot of people believe HTML5/JavaScript applications are the future but, with the current state of JavaScript and the fragmented and rather motley collection of JS libraries and frameworks I find it hard to believe how that can happen for a very long time.

People have been saying for perhaps a decade that eventually desktop and web applications will merge, and HTML5 and the recent advances in JavaScript engines and libraries represent a huge advance in that direction, but unless there is something truly radical on the horizon then I can't see how this can happen for another decade or so.

So where does this leave my web development efforts? Well I will certainly be continuing to work on HTML5 and JavaScript to push the envelope of what web apps can do, but as for any ideas I might have had a few months ago of desktop-like plugin-free apps running in a browser - err, no, not quite yet!

No comments:

Post a Comment