December 28, 2005

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!

Close

On Twitter now

Application development

Powered by Twitter

White Paper

D2D Virtual Tape Library Replication Primer

This whitepaper explains the terminology and concepts behind Data Replication technologies and establishes some sizing rules through worked examples. Learn the new paradigm in disaster tolerance—protect data anywhere.

Download now »

White Paper

An Alternative to Virtualization for Datacenter Cost Savings

Server virtualization is a popular option for dealing with mounting datacenter costs. Another equally promising approach is the use of an Application Delivery Controller. Citrix NetScaler provides a low-cost way for organizations to reduce their server count and accrue cost savings from a reduction in space, cooling, power and personnel.

Download now »

White Paper

Why Your Firewall, VPN, and IEEE 802.11i Aren't Enough to Protect Your Network

The emergence of WLANs has created a new breed of security threats to enterprise networks.

Included in HP ProCurve WLAN solutions is security technology that alleviates threats from WLANs through:
* Monitoring wireless activity inside and out of the enterprise
* Classifying WLAN transmissions into harmful and harmless
* Preventing transmissions that pose a security threat to the enterprise network
* Locating participating devices for physical remediation

Download now »

White Paper

Bringing the Edge to the Data Center

Effectively address data protection challenges, implementing solutions that help store and protect business–critical data while cutting costs and improving efficiency and reliability.

Download now »

Sign up to receive InfoWorld Resource Alerts

Subscribe to the Developer World Newsletter

Receive a weekly roundup about the art and science of software development.

©1994-2009 Infoworld, Inc.