Sunday, June 22, 2008

Why ActionScript is in the Tiobe Programming Community Index Top Twenty

The June 2008 edition of the Tiobe Programming Community Index highlights the fact (in its introductory text) that ActionScript has entered the index's top twenty. This places ActionScript higher on the index than such venerable languages as Fortran and Smalltalk and above trendy languages such as Groovy, Erlang, and Scala.

I have written about things I like about ActionScript 3.0 in other blog entries, but I am using this blog entry to articulate in one place some of the things I most like about ActionScript 3.0 in honor of this Top 20 June 2008 ranking.

UPDATE (15 August 2008): The announcement this week that the ECMAScript committee has decided to move on a smaller incremental version of ECMAScript (3.1) rather than the complete overhaul originally envisioned for ECMAScript 4 can be disheartening for many of us. However, if the browser vendors are able to fully and completely meet the reduced ECMAScript 3.1 standard, that is a positive. Also, it sounds like ActionScript will continue to be a forward-leaning web language despite this decision.

What I Like Most About ActionScript (at least today!)

1. Browser Differences Are Just a Terrible Memory

Although there are things I really don't like about JavaScript, by far my biggest problem with JavaScript is the need to write different code for different browsers. If ActionScript provided no other advantage than the fact that I could write it once for any browser, it would be worth using. Interestingly, this is essentially what OpenLaszlo provides -- a subset of JavaScript that allows the developer to write to the same API regardless of browser. ActionScript goes well beyond JavaScript as most of us know it and as described in the remaining advantages listed next.

2. Static Typing

At home or when working on small projects, there are many things I enjoy about a dynamically typed language such as Ruby. However, when working on large enterprise applications with large groups of developers, I have found static languages to be preferable. It is a matter of personal taste, but my preference is to have the static support (default for ActionScript 3.0 in Flex 2 and Flex 3). For those who prefer dynamic typing, Flex allows the static typing to be turned off.

3. Class-Based Object-Oriented Features

JavaScript's prototype-based object-orientation has always been difficult for me to apply effectively, primarily because I keep trying to force my thinking about JavaScript into my experience with C++, Java, and C#. I'm not alone in this as evidenced by the fact that so much JavaScript I encounter simply doesn't take advantage of the prototype features.

4. ActionScript is Standards-Oriented

Because the major web browsers do not collectively fully support the ECMAScript (ECMA-262) specification, this standard is less valuable than it otherwise might be. Having said that, the announcement that Microsoft Internet Explorer 8 will be standards compliant is heartening and gives us hope that web developers will one day be able to write significant ECMAScript-based applications that work across browsers. ActionScript is Adobe's implementation of what they predict ECMAScript Edition 4 to evolve to. ActionScript also provides support for ECMAScript for XML (E4X).

5. ActionScript and Mozilla Tamarin

In my opinion, it bodes well for ActionScript and developers learning ActionScript that Mozilla has accepted Adobe's contribution of ActionScript Virtual Machine to the Mozilla Tamarin project. Adobe has contributed many members of the Tamarin project and the current plans are to use the same ECMAScript Edition 4 implementation in Mozilla 2 (Firefox 4) and Adobe's ActionScript implementations.

6. ActionScript is Friendly to Java Developers

Experience with Java is usually of very little benefit when learning JavaScript and can even be a detriment. ActionScript, however, uses many features, syntax, and concepts that are very similar to Java. As discussed above, ActionScript supports static typing and class-based object-oriented features similar to Java. Another example is that ActionScript also provides a Javadoc-like tool called ASDoc.

7. ActionScript Complements Other Programming Languages

I like to be comfortable with multiple languages because different languages are best suited for different types of problems. ActionScript is one of those languages that a developer is likely to use in conjunction with one or more other languages. Especially within in Flex applications, ActionScript will often be used on the client side and a server-side language such as Java/Java EE, Ruby, Python, or Perl will be used with the Flex front-end. What this means is that ActionScript does not necessarily replace anyone's favorite language, but complements developers' favorite languages. Even the language that ActionScript might be mostly likely to replace (JavaScript) can be used with ActionScript. Because of this nature of ActionScript's common use case, ActionScript may sometimes avoid or be less affected by the defensiveness of developers who might think their favorite language is threatened by ActionScript's growing popularity.


With so many developers discovering the ease and power of using Flex, it is not surprising that ActionScript is gaining in popularity. In this blog entry, I've attempted to describe some reasons why I believe ActionScript is so popular for web development (and, with AIR, for desktop development). The rising popularity of Flex necessarily brings ActionScript along for the ride (much in the same way the Ruby on Rails framework brought Ruby newfound fame), but ActionScript has many positive features of its own (just as Ruby has many positive features of its own) to keep developers interested and happy.


By the way, I'm not the only one who has run into significant issues with JavaScript. Evidence of this is the title of the recently released book JavaScript: The Good Parts. Not only does the title imply that there are significant "bad parts," but the book's description goes beyond implication and explicitly spells out that JavaScript has some more than its fair share of issues.

No comments: