What's New in the 5th Edition

| 2 Comments

At another blog I saw someone comment that they'd been looking for a list of what is new in the 5th edition of JavaScript: The Definitive Guide. I guess I haven't blogged about this yet. If you were looking at the book in a bookstore, you'd just turn to the Preface and read the section titled "What's New in the Fifth Edition". But if you're considering an online purchase, you can't do that. So, here's what I say about the new edition in the preface:

What s New in the Fifth Edition

In Part I, Core JavaScript, the chapter on functions (Chapter 8) has been expanded, with particular emphasis on nested functions and closures. The material on defining your own classes has also been expanded and moved to a chapter of its own (Chapter 9). Chapter 10 is another new chapter that covers namespaces, which are essential for writing modular, reusable code. Finally, Chapter 12 demonstrates how to use JavaScript to actually script Java; it shows how to embed a JavaScript interpreter within a Java 6 application and how to use JavaScript to create Java objects and invoke methods on those objects.

In Part II, Client-Side JavaScript, the coverage of the legacy (Level 0) Document Object Model has been merged with the coverage of the W3C standard DOM. Because the DOM is now universally implemented, there is no need for two separate chapters on manipulating documents. The biggest change in Part II, however, is the amount of new material:

  • Chapter 19, Cookies and Client-Side Persistence, has updated coverage of cookies and new coverage of other client-side persistence techniques.
  • Chapter 20, Scripting HTTP, explains how to make scripted HTTP requests using the powerful XMLHttpRequest object, which is the enabling technology for Ajax-style web applications.
  • Chapter 21, JavaScript and XML, demonstrates how to use JavaScript to create, load, parse, transform, query, serialize, and extract information from XML documents. It also introduces the E4X extension to the core JavaScript language.
  • Chapter 22, Scripted Client-Side Graphics, explains JavaScript's graphics capabilities. It covers simple image rollovers and animations but also explains advanced scripted graphics using the cutting-edge <canvas> tag. It also demonstrates other ways to create dynamic, scripted client-side graphics using SVG, VML, the Flash plug-in, and the Java plug-in.
  • Chapter 23, Scripting Java Applets and Flash Movies, has added coverage of the Flash plug-in to its coverage of the Java plug-in. It now explains how to script Flash movies as well as Java applets.

Part III, the reference section for the core JavaScript API, is little changed from the previous edition, because that API has remained stable. If you have used the fourth edition, you'll find this part of the book comfortingly familiar.

The big change to the reference material is that the documentation of the DOM API, which was previously segregated into a section of its own, has been fully integrated into Part IV, the client-side JavaScript reference section. Now there is only one client-side reference section to consult. No more looking up the Document object in one reference section and then looking up the HTMLDocument object in the other. Reference material for DOM interfaces that were never (widely) implemented in web browsers has simply been cut. The NodeIterator interface, for example, is simply not available in web browsers, and it no longer clutters up this book. The focus has also been moved away from the awkwardly formal interfaces defined by the DOM specification and onto the JavaScript objects that actually implement those interfaces. So, for example, getComputedStyle() is now documented as a method of the Window object, where you d expect it, rather than as a method of the AbstractView interface. There is no reason that client-side JavaScript programmers should care about AbstractView, and it has simply been removed from the reference. All these changes result in a simpler, easier-to-use client-side reference section.

In addition to the big changes described above, there are lots of little changes throughout, to remove outdated material, update the examples to use unobtrusive techniques and so forth. I have already blogged about the fact that the new edition has more than twice the example code of the fourth edition.

If you're thinking of upgrading, I hope this helps!

Update: comments now closed. Spammers found this thread over the long weekend.

2 Comments

I'm just (im)patiently waiting for it to appear in Canadian bookstores!

The 5th edition is now also available on Safari, btw, and I have it on my online bookshelf :-)

I must admit that when I started reading the 5th edition, I quickly started to look forward to the 6th edition, although the 5th edition is well worth getting for anybody that works with Javascript.

The 5th edition seems to do some selective catching up and shies away even from Javascript 1.6 additions that look certain to be part of ECMA-262 version 4. Apparently, you drew a carfully drafted line for what you wanted to include in the 5th edition and were thinking ahead to the 6th edition already. That's not a bad thing, of course. The result is a very clean 5th edition.

To bad E4X ended up getting buried in the Client-Side section. I hope the 6th edition will treat it as an extension of Javascript Core instead. Hopefully, including mentioning it in the Literals sections and in chapter 3, even-though it is an optional "standard extension".

One of the things that makes this book so great is the fact that it cleanly separates between the browser/client side and the core language, making it the best companion when working in Rhino based environments on the server-side such as Helma (www.helma.org).

Naturally, when working in an environment like Helma, the limitations on using the newest language extensions do not apply, and the 5th edition doesn't quite cater to this niche as well as it could.

So, basically, I hope for a bit more "Rhino" in the 6th edition of the "Rhino book" ;-) ...and maybe even a chapter on existing server-side frameworks.

Books

Comprehensive coverage of Ruby 1.8 and 1.9

"The New Most Important Ruby Book"
Peter Cooper,
rubyinside.com

Completely updated for Ajax and Web 2.0

"A must-have reference"
Brendan Eich,
creator of JavaScript

The classic Java quick-reference

Advertising

Pages

Hosted By

Powered by Movable Type 4.21-en