Analysis - Whither JavaScript?
Whither JavaScript ?

In the complex world of web development, arriving at good, open standards - even for a language as solid as JavaScript - can be a mysterious and complex processs. Currently improvements to ECMAScript are coming from some key non-Netscape sources.

Finding who is currently responsible for the scripting language, Javascript, is a bit confusing. Sure I knew that Netscape originated the language in the Web's heady days around 1995 when both Java and JavaScript(see the original press release) emerged from Sun and Netscape respectively. But what had happened to JavaScript in the interim since certain parties "cut off the oxygen" to Netscape by promising to give away their Internet Explorer browser for free and their IIS Web Server for free in perpetuity? Well Microsoft has just settled with AOL, current owners of Netscape, to the tune of $750 million their antitrust civil lawsuit. But had JavaScript been sold or established as an open project like Open Office developers of Star Office or Mozilla, the organization responsible for the basic engine for the Netscape browser ? Or had JavaScript become the responsibility of ECMA-the European Computer Manufacturers Association which is the standard body for JavaScript (designated ECMAScript) and also incidentally,for Microsoft's C# and the open portion of .NET framework?

What emerges is a great diffusion of responsibilitieswhich like the SCO vs Linux controversy, who owns what and who is responsible for the entity that is JavaScript/JScript/ ECMAScript - well that is subject to interpretation.

ECMAScript : Not-To-War Document

One of the consequences of the browser wars of 1996 through 1999 between Microsoft and Netscape is that all the major browser standards - HTML, CSS, DOM, and JavaScript/JScript still remain scarred - that is they are tenuously compatible in many key areas. Partially this is due to the fact that IE6 is over two years old and has only received quarterly security breach updates. In contrast, in this same period Mozilla and Opera browsers have seen 2-3 updates and now are very standards compliant. Partially this is due to the DOT.Com Bust - Netscape has not updated JavaScript beyond the 1.5 version of 1999-2003.

Whatever the reason, Javascript has remained in the doldrums. But this should not be because there is a lot to do and fix. For example, whenever doing anything new on the Webin JavaScript, a savvy colleague's rule of thumb is to add 30% more time to resolve inconsistencies between browser implementations. Strange, but code like if (NS6plus || MZx)doItThisWay(); elseif (IE4 || IE5 && !IE6)doItAnotherWay() considered par for the course. My own experience says have a good JavaScript debugger for both Microsoft and Netscape browsers because that is where most of the incompatible action takes place. Also of great help are books like Steve Holzner's JavaScript Unleashed or Danny Goodman's The Definitive Guide to DHTML which give all the gory details about JavaScript/JScript command in/compatibility with all the major browser editions along with their own good examples of cross browser JavaScript code.

So at the height of the browser wars with IT organizations demanding some compatibility between languages, ECMAScript evolved not as sign of peace but as a minimum declaration of what was compatible between NetScape's JavaScript and Microsoft's JScript. And since then neither of the two parties have backed off their agressively different versions of javaScript. But to their credit for the past 4 years, ECMA have been working to resolve the differences . On their website ECMA declares that "ECMA is in the process of harmonizing the various diverging extensions of ECMAScript. The full second version of the language is scheduled for publication in 2003 Q1".

Now that publication came close but did not officially happen. However there have been major proposers of JavaScript 2.0 standards. and changes to JavaScript. Netscape and Mozilla both have very close but slightly different ECMAScript 4/JavaScript 2.0 proposed standards. But also BEA proposed extensions to the basic syntax of JavaScript in early March 2003. So there is a lot of jostling going on around JavaScript. And why not ?- it is becoming increasingly valuable in the ISV community.

JavaScript- Valuable Commodity

There is no doubt that JavaScript has become increasingly used by ISVs and therefore valued.. First it is a fairly simple language to pickup with its Java-like syntax, operators, and flow of control. But its dynamic, nearly typeless variables; easy array definitions and processing; plus robust but very approachable object model make it very easy to program and develop in. ECMA estimates that 70% of all browser pages incorporate some ECMAScript-compaible code. As well Mozilla/Netscape make available two open source versions (C++ and Java) of JavaScript for free download.

Microsoft's variant, JScript, has been updated to be a full .NET enabled programming language. In this context JScript gains the benefit of dynamically compiled execution which can be important for large-scale applications. Also given that VB.NET has moved so close to C# in design and complexity, Microsoft needs a simple, easy to use yet OO-capable language to fill in the complexity gap in its .NET language offerings. And JScript has not just client-side but also server-side capabilities. Finally, JScript is the model for Microsoft's WSH - Windows Scripting Host batch control language.

And Microsoft is not alone - Macromedia has heavily invested in JavaScript. It uses JavaScript as the macro command language for many of its applications and its ActionScript command language for Flash adheres to ECMAScript edition 2 (the current standard is edition 3). the recently released Flash Mx 2004 with its ActionScript 2 adheres fairly closely to ECMAScript 4/JavaScript 2

In a similar fashion, Adobe uses JavaScript for macros in its GoLive web development tool and ActionScript in its LiveMotion animation tool. And since freely downloadable JavaScript engines are available JavaScript has been adopted by nearly a dozen independent software vendors. For example, Mozilla uses JavaScript 1.5 in helping to implement its browser. javaScript 1.5 folows 1.4 in beefing up error and exception capture/trapping along with minor enhamvement like getters/setters, const keyword, and number formatting. Netscape's Waldemar Horwat summarizes JavaScript 2/ECMAScript 4 by telling us what itis NOT to be used for:
-High-performance applications
-General language
-Language for writing huge programs
-Stripped-down version of existing language
In fact, the designers of JavaScript 2.0 see it as a glue language with strong capability to run cross platform and support/integrate with a wide range of programming and scripting languages. To that end, JavaScript which is nearlytypeless has had to recognize the common programming language types like inger, float, byte, boolean, double, etc. A strict mode option switch forces JavaScript 2 programs to enforce strict variable definitions, namespace observation, and function reference compatibility. Finally JavaScript 2 adopts a modern OO defintion of classes and namespaces - which considerably changes object declarations versus JavaScript 1.5 but on the other hand considerably simplifies class declarations and brings them in line with Java, C++ and other OO languages. In short, JavaScript 2.0 is a tune-up and simplifying of coding semantics to help developers program more effectively in the language. Macromedia seems to agree - keying its ActionScript 2 language to follow the JavaScript 2.0 recommendation.


So JavaScript prospers despite the wounds from browser wars. For example, BEA's E4X proposal to extend the syntax of JavaScript in Mid March of 2003 garnered praise from Microsoft, Mozilla and RIM. It changes the syntax of the language by adding a new construct to the for loop - for( var atom in srcDoc..Atom) //Loops through each Atom tag in the source XML - changes the internal syntax of JavaScript. The result certainly simplifies XML as the demo linked to above readily shows. This puts JavaScript back on par with Perl and PHP which have nifty foreach command syntax which is very useful in processing associative arrays and XML tags. But curiously, there was no comment on this proposal by key JavaScript players like Netscape, Macromedia nor Adobe. So like the atomic particles whizzing by in the nearby CERN bubble chambers, ECMA officials are hard pressed to explain the reaction or even prognosticate on how the E4X extension will proceed. Perhaps, this is an example of how hard it is to draw sweet water from a browser-war poisoned well. At the very least it casts light on the delicate process of arriving at good, open standards.

 Top of Page  Open Sourcery Home Tips & Tutorials  
©Imagenation 2001-2004