ECMAScript: The Switzerland of development?

27.12.2005
There is a perpetual debate in programming circles about the pros and cons of static vs. dynamic typing. I've always favored dynamically typed languages, such as Lisp, Perl, and Python, because my own coding efforts tend to focus on application prototyping, content wrangling, data analysis, and system automation.

So I sometimes struggle to explain to developers who use only statically typed languages how and why dynamic typing can simplify and accelerate these exploratory kinds of tasks. Those developers in turn sometimes struggle to explain to me how and why statically typed languages, such as C++, Java, and C#, can facilitate large-scale development and integration.

Perhaps these styles will turn out more complementary than we suspect. If so, the ECMAScript family of languages, which includes the various Java­Script dialects and Macromedia's ActionScript, will be one lab in which the hypothesis is tested.

The AJAX (Asynchronous JavaScript and XML) juggernaut is one driver of the trend, having conferred new respect on JavaScript. Then there's Macromedia's Flex platform. To meet the needs of Java-oriented enterprise developers, the company's ActionScript dialect has evolved in the direction of ECMAScript Edition 4 -- an envisioned (but stalled) future standard that was sketched out by Netscape in a June 2003 straw-man proposal. Versions 2 and 3 of ActionScript add Java-like class and interface definitions to the language. They also provide optional static typing.

Among other benefits, declared types enable Flex Builder 2 -- the Flex IDE that is now wholly reconstituted as an Eclipse plug-in -- to support interactive statement completion. This is the killer feature that Microsoft trademarked as IntelliSense. Java and C# programmers couldn't live without it. Aficionados of dynamically typed languages do get by without it, but secretly envy how the other half lives.

When I returned from the Microsoft Professional Developers Conference this year, I was ready to openly proclaim that envy. In session after session, presenters were IntelliSensing their way through live coding exercises. The most impressive example came from Anders Hejlsberg, who showed how the type-aware implementation of LINQ (language-integrated query) exposed XML and SQL data structures to the power of IntelliSense.