Some Controversy over ECMAScript 4

Last week, I presented a first look at ECMAScript 4, the standard that Adobe uses as a basis for ActionScript. What I hadn’t yet discovered when I posted is that ES4 has caused a bit of controversy among the wider web developer community. We developers on the Flash side don’t always stay in touch with the developers using JavaScript, so I thought I’d highlight some of the arguments and conversations.

Some prominent JavaScript developers, including Douglas Crockford (creator of JSON and a fellow Yahoo) and some folks from Microsoft, believe that the changes in ES4 are too drastic and don’t address problems that should have been fixed. Douglas points out that JavaScript is inherently unsafe, and he argues that ES4 does nothing to fix the security risks. Another common argument is that nothing proposed in ES4 adds functionality that couldn’t be done in the previous version. In short, what’s more important? New functionality that wasn’t available before or better syntax for existing functionality?

The new syntax makes ECMAScript more like traditional programming languages, but the language also aims to stay backwards compatible with the current version. In other words, you can build classes using the new class syntax or you may use prototype like JS developers do today (sort of like how AS1 and AS2 gave us these same options in Flash for a long time). It raises a question in many minds, “Why?”.

The web may face an ugly transition involving widely different coding styles, and poor support for the new syntax across browsers. After almost a decade, developers encounter many differences across implementations of the current version of JavaScript. With so many new syntax options, bugs may cause heavy incompatibilities among early implementations of the new version. While the previously-mentioned version transition in ActionScript was mostly smooth, the browser world has a very different ecosystem that could make widespread adoption of the syntax changes more difficult.

Links

An interesting discussion overall. I’ll be watching with fascination to see what happens to “the language of the web” over the next year. Do I expect major changes to ES4 that could affect the next updates to ActionScript? Not particularly, but the desire for a language that stays true to JavaScript’s current version is strong among those that oppose ES4. I can’t say whether another JS-like language will be proposed as an alternative to ES4, but it’s certainly a possibility. I’m curious to see what happens.

Update: New information about this topic is available in my article How will ECMAScript “Harmony” affect ActionScript 3.

About Josh Tynjala

Josh Tynjala is a frontend developer, open source contributor, bowler hat enthusiast, and karaoke addict. You might be familiar with his project, Feathers UI, an open source user interface library for Starling Framework that is included in the Adobe Gaming SDK.

Discussion

  1. scott schmitz

    Since the last time the standards body has agreed to something has been 1999, I think delay is simply stupid. Please keep moving forward.

    I use JavaScript as a full-time profession and must agree that there are things that need improvement. The issues with Javasscript are completely obvious to anyone who uses it every day. Simply put, it has stagnated and needs improvements. The web pages we were doing in 1999 are nothing like what we are doing now! So, it stands to reason that we need to improve the language.

    You must change or die!

    As far as incompatibility – I think you need to address this with specific test cases. You must put together a massive automated set of Javascript tests to validate compatibility. I suspect that the complaints revolve around what are really Microsoft bugs – which, obviously require a bug fix from Microsoft, but not necessarily a change in the standard!

    As far as the language getting too large, that’s really best determined by the number of lines of C++ code it takes to implement, the memory footprint, the execution speed. So, I would suggest that the reference implementations better darn well demonstrate that these language changes are wise. After all, these standards will go into mobile phones!

    As far as the language getting too complicated for people just trying to hack some code – this seems a spurious argument as long as the language is backwards compatible. So, just make sure it stays backwards incompatible.

    I urge you to do the best job you can. My long-term livelihood depends upon you.

    Scott.

  2. Pingback: Discover ECMAScript 4: The Future of ActionScript - Josh Talks Flash