ECMAScript: The Switzerland of development environments?

The latest tools from Macromedia show how a programming language can stay neutral to coding practices

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.

But then a funny thing happened. Charles Petzold, the legendary programmer who introduced the newborn Windows platform to its first generation of developers, published a talk he'd given to the New York .Net Developer's Group. In his title he asked the provocative question, "Does Visual Studio Rot the Mind?"

Assistive technologies shouldn't govern creative thought, Petzold argued, but that's just what happens when, in order to get IntelliSense to work, you must predefine every class, method, property, field, parameter, and variable before you can refer to it.

"Of course I could always just turn it off," Petzold said. But then, acknowledging his love/hate relationship with IntelliSense, he added: "And go cold turkey? I think not."

With ActionScript 3.0, you can have it both ways, as Flex evangelist Christophe Coenraets recently pointed out when showing me Flex Builder 2. When you already know what your types should be, he said, declare them. When you don't, don't. One language, two styles, complementary benefits. Good idea!

From CIO: 8 Free Online Courses to Grow Your Tech Skills
Join the discussion
Be the first to comment on this article. Our Commenting Policies