Web DevCenter
oreilly.comSafari Books Online.Conferences.
MySQL Conference and Expo April 14-17, 2008, Santa Clara, CA

Sponsored Developer Resources

Web Columns
Adobe GoLive
Essential JavaScript

Web Topics
All Articles
Scripting Languages

Atom 1.0 Feed RSS 1.0 Feed RSS 2.0 Feed

Learning Lab

[ David Flanagan ]

An Interview with David Flanagan

by Bruce Stewart

David Flanagan is one of O'Reilly's most prolific authors, specializing in Java and JavaScript. David has just finished a major update to JavaScript: The Definitive Guide, 4th Edition, and we recently spoke with him about what's new in the latest edition, the state of JavaScript, and how Netscape has improved its support for Web standards.

Stewart: How would you describe the current state of JavaScript? Is its use still growing, or do you think it has reached a plateau as a Web technology?

Flanagan: I'm sure that its use has taken a temporary hit along with the rest of the dot-com economy, but I think that in the larger picture the use of JavaScript will continue to grow for some time. The DOM capabilities of the latest standards-compliant browsers give new power to JavaScript code in Web pages and provide more reason than ever for developers to learn the language.

Also, with two open source implementations (one in C and one in Java) of the JavaScript interpreter available from mozilla.org, JavaScript is being adopted as the scripting language of more and more applications, which means developers will find more useful niches for their JavaScript programming skills.

Related Reading

JavaScript: The Definitive Guide, 4th EditionJavaScript: The Definitive Guide, 4th Edition
By David Flanagan
Table of Contents
Sample Chapter
Full Description

Stewart: What's new in this latest edition of JavaScript: The Definitive Guide?

Flanagan: The new edition is a much-needed update that brings coverage of the core language from JavaScript 1.2 all the way to the current version, JavaScript 1.5. On the client side, the book includes complete W3C DOM standard documentation, both for Level 1 and the cutting-edge features of Level 2. The DOM standard is a document object model defined by the World Wide Web Consortium. It gives JavaScript complete control over the document content displayed in a Web browser window and enables sophisticated and powerful dynamic HTML in a platform-independent way.

Platform independence is a theme that runs throughout the book. The early editions of my book leaned heavily towards Netscape's implementations, for the key reason that they were the primary innovators of the language. That Netscape-centricity has diminished with each subsequent edition, and it is mostly gone from this one. That is not to say that I've switched over to Internet Explorer-centricity. Instead, the newest edition focuses on standards and not on individual implementations: the ECMAScript version 3 standard for the core JavaScript language, and the W3C DOM standard for client-side JavaScript.

The newest edition focuses on standards and not on individual implementations: the ECMAScript version 3 standard for the core JavaScript language, and the W3C DOM standard for client-side JavaScript.

Another big change is a structural one. I've split the reference section into three distinct parts. The first part documents core JavaScript objects, methods, and properties. Because JavaScript is being used in environments other than Web browsers, it is useful to keep this material separate from the client-side material. The second reference section documents the legacy client-side material, sometimes known as the Level 0 DOM. This material has not changed much from the third edition, and it will be comfortingly familiar to readers of that edition. The third reference section is all new: it covers the objects, methods, and properties defined by Level 1 and Level 2 of the W3C DOM standards. I've kept this DOM standard, client-side reference material separate from the legacy client-side reference material because I believe that for any given project, a developer will use either the legacy API or the new DOM API, without much switching between them.

Stewart: Can you give us some examples of environments other than Web browsers where JavaScript is being used today? Do you expect JavaScript's role in these areas to grow?

Flanagan: JavaScript is being used to drive the Mozilla and Netscape 6 GUIs. That usage is in a Web browser, but is used for a very different purpose than traditional client-side JavaScript. JavaScript is used as the scripting language for an open source three-dimensional modeling and animation system known as K-3D. Some other projects are listed at the Mozilla site; several of them are variants on server-side JavaScript. I suspect there are a number of other JavaScript-enabled applications out there, but I haven't been following this area carefully enough to know what they are.

Stewart: Is JavaScript still evolving? What is important or noteworthy in the latest 1.5 version of JavaScript?

Flanagan: The major new feature of JavaScript version 1.5 (which corresponds to version 3 of the ECMAScript standard) is exception handling with the Java-style try/catch/finally statement and the throw statement. ECMAScript v3 also has a number of miscellaneous changes throughout. It standardizes things, such as the switch statement and regular expressions, that were not previously standardized. With JavaScript 1.5, the language has reached maturity. It has a fairly complete set of features, a stable standard, and multiple independent implementations that seem to support the standard quite well.

With JavaScript 1.5, the language has reached maturity. It has a fairly complete set of features, a stable standard, and multiple independent implementations that seem to support the standard quite well.

Although JavaScript has matured, it does continue to evolve. Members of the ECMA committee that produced the ECMAScript standards are at work on ECMAScript version 4, which will correspond to JavaScript 2.0. This major new version of the language takes a simple scripting language and turns it into a fully modular and object-oriented programming environment, suitable not just for scripting Web pages, but for developing large software projects. The current schedule calls for the release of the ECMAScript version 4 standard sometime in 2002. Although the new version of the language has many compelling features, it is also much more complicated than the current version, and I don't expect it to be commonly used in Web pages any time soon. It may be adopted in other contexts sooner, however.

Stewart: JavaScript seems to have earned a solid spot in the Web developer's toolkit. Do you consider it required knowledge for today's Web developers?

Flanagan: Yes. It has become common enough that you can't work with the Web and not encounter JavaScript code. Some developers can get by with just a cut-and-paste or cookbook knowledge of JavaScript, but in the long run, I think it is worth taking the time to learn the language.

Stewart: Are there any new or exciting applications you're seeing JavaScript being used for?

Flanagan: Mozilla and the Netscape 6.x browsers are fully "skinnable" and can have their look and feel changed dynamically. This is enabled by a Mozilla technology known as XUL, based on XML and JavaScript. Inside the browser window itself, people are doing sophisticated things with the new DOM standard. These include HTML tables that can sort themselves, mini windows that can be dragged around within the browser window, and bar charts drawn purely on the client side with HTML, CSS, and JavaScript (there are examples of how to drag objects and draw bar charts in the new edition of JavaScript: The Definitive Guide).

Stewart: It created quite a stir when O'Reilly published your article Netscape Navigator 6.0 to Fail Standards Compliance just about a year ago, detailing some of the serious bugs that Netscape 6 was about to ship with and its lack of support for Web standards, including problems with the DOM and JavaScript. Can you update us on the status of Netscape's support of Web standards?

Flanagan: That article really touched a raw nerve. Lots of developers still felt an allegiance to or fondness for Netscape, but they were frustrated that Netscape (and Mozilla) had been unable for so long to ship an updated browser. When I pointed out that Netscape was finally about to ship a browser, but that it would not be all that we had hoped it would, I guess a lot of that frustration boiled over. The article raised hackles at Netscape, too, and in hindsight, I should not have used the word "Fail" in the title. As Netscape rightly pointed out, Netscape 6 had better standards compliance than any other browser. My intended point was that beta releases of Netscape 6 were not ready for prime time yet, and that there were many standards-related bugs that could be easily fixed, but which would not be fixed because of the tight and inflexible release schedule.

Despite the pleas of developers, Netscape 6 was released as it was. It has come and gone, superseded by Netscape 6.1 and 6.2, both of which are a lot more stable, and in which have been fixed all of the specific, standards-related bugs I pointed out in my article. I don't use Netscape 6.x myself because it has too many Netscape-centric things, such as the Shop button. My favorite subversive feature of Mozilla has also been disabled, which allowed me to selectively turn off images from certain servers, such as those that deliver advertising. Netscape 6.x continues to have excellent support for Web standards. And because Mozilla is updated more often than Netscape, it has cutting-edge support for those standards: better than any other browser.

Stewart: It sounds like you've been keeping up with the Mozilla project. What is your impression of the latest builds?

Flanagan: They are doing a good job of bringing all the pieces together and closing in on a 1.0 release. I applaud their effort, but I find that I still use Netscape 4.7 at least as often as I do Mozilla. Because Mozilla still runs a little sluggishly on my 450MHz Linux box, I don't use it as often as I ought to. Some have laid the blame for Mozilla's slowness on its reliance on interpreted XUL for its user interface. When I can make the time, I look forward to experimenting with some of the browsers that have adopted Mozilla's Gecko rendering engine, but have put their own non-XUL user interface on it. My hope is that those browsers will give me the standards compliance of Mozilla with the speed of Netscape 4.

Stewart: Do you see any technologies poised to take over JavaScript's role in Web development?

Flanagan: No. My writing work keeps me pretty focused on JavaScript and Java, so maybe I just don't have my eyes open to new technologies, but I'm convinced that JavaScript is here to stay. Internet Explorer allows you to use Visual Basic scripts in a Web page instead of JavaScript scripts, but I don't think many Web developers actually do that.

Stewart: Now that you've finished updating JavaScript: The Definitive Guide, what's next on your plate?

Flanagan: The fourth edition of Java in a Nutshell, to cover Java 1.4. After that, probably the third edition of Java Examples in a Nutshell, also to cover Java 1.4.

Stewart: If we were to look at books on your home bookshelf, which titles would show signs of the heaviest use?

Flanagan: Like many programmers, I secretly wish (sometimes, at least) that I was a real architect. Thus, the book A Pattern Language, by Christopher Alexander et al., is an inspiration to me. (I believe it was also the inspiration for Gamma et al., who wrote the modern programming classic Design Patterns.) Other books that inspire the designer in me are Design for the Real World by Victor Papanek and Permaculture: A Designer's Manual by Bill Mollison.

My favorite nonfiction author (although I enjoy his novels and poetry too) is Wendell Berry, a tremendously gifted essayist, who has a magic way with words. I would love to be able to write with the power and grace that he does. I like almost everything he has written; two of my favorites are What are People For? and The Unsettling of America.

Other books that I feel are particularly important, and that enjoy a place of honor on my bookshelf include:

  • Natural Capitalism: Creating the Next Industrial Revolution by Paul Hawken, Amory Lovins, and L. Hunter Lovins

  • The Ecology of Commerce: A Declaration of Sustainability by Paul Hawken

  • Small is Beautiful: Economics as if People Mattered by E. F. Schumaker

  • Beyond Growth: The Economics of Sustainable Development by Herman Daly

I used to be a frequent science fiction reader; now I read it only as an occasional escape. My favorite fiction author is Samuel Delany: I have a nearly complete collection of his books, several of which are autographed, and they bear the marks of multiple rereadings. I've recently reread some Neal Stephenson works--my favorite is Zodiac. I'm also fond of cyberpunk authors William Gibson and Bruce Sterling.

Bruce Stewart is a freelance technology writer and editor.

O'Reilly & Associates recently released (November 2001) JavaScript: The Defintive Guide, 4th Edition.

Return to the JavaScript and CSS DevCenter.