A work in progress

I am in the process of rewriting Eloquent JavaScript, bringing it up to date to the web of 2014, making use of ECMAScript 5, and generally improving its style and content. The new version will be released under the Creative Commons Attribution-NonCommercial license.

   →  See my progress here (github).

Work on the new edition was kindly sponsored by a lot of crowd-funders. Thank you all. A special shout-out to Mozilla and Hack Reactor, who both contributed about ⅓ of the goal amount.

The plan

For future reference, these are the things promised in the crowd-funding drive:

Rewrite and modernize

I've learned a lot in the past five years, and the world of web programming itself has also moved forward swiftly.

For one thing, the current text describes ECMAScript version 3, and makes only a passing mention of version 5 of the language. Many of the helper functions the book introduces are available as built-in methods in ECMAScript 5.

I want to keep deriving and defining these functions in the text, but also introduce the built-in variants, and, in subsequent example code, use those instead of non-standard utilities that are specific to the book.

That, in combination with using console.log instead of a custom print function, will make the snippets in the book stand-alone vanilla JavaScript code, rather than depending on the environment provided by the book's sandbox.

There are some sections (for example those on recursion and closures) that have generated a lot of questions. I'm taking that as a sign that I should rewrite and expand them to be easier to follow.

Finally, the writing style is often somewhat stilted, and the structure of the text could do with quite a lot of clarification and improvement. The whole text needs attention.

Rewrite the DOM chapters

If you read chapter 11 to 14 of the online book, you'll notice that they feel a little rushed. As if the author didn't really want to write them. This is accurate. The awkwardness of browser programming in the IE6 era, combined with the fact that I wasn't actually that knowledgeable in the subject at the time, made it hard for me to put together a solid set of chapters. It shows.

To make things worse, I'm recommending some odd practices, such as binding $ to document.getElementById (which, in this jQuery-dominated world, is quite confusing), and use some rather confused terminology.

So what I want to do is to largely rewrite those chapters. I'll de-emphasize old-browser compatibility issues, get rid of the lame enumerations of methods and properties, and take a more big-picture approach to explaining what browsers provide, and how to interact with them. The examples in these chapters also need to be rethought, and unified into a couple of more interesting projects.

Write a node.js chapter

Node.js is genius. It's a kind of universal network duct tape with a well-thought-out programming interface and wonderful library ecosystem that makes it easy, and even fun to write all kinds of servers and utilities.

I think I'll be doing starting JavaScript programmers a service by exposing them to this way of using JavaScript—it'll expand their reach outside of the browser.

This chapter would explain the concept of node.js, and build a few simple servers with it, illustrating what server-side programming is and how it complements client-side programming.

Improve coding sandbox

At the time, I thought pulling off a pseudo-Firebug console in the web page was a rather cool stunt. But at this point I can't help but feel that it looks terribly dated. And what's worse, it's painful to use.

A much better solution would be to have the interactive coding happen in-line in the text. I.e. you'd be able to simply click examples to start editing them. Output would be shown below the piece of code that was run. Exercises would come with an empty box to write the answer in. That gets rid of the silly bar at the bottom and the cramped little editor.

The fact that the code examples in the book depend on each other, and that you often need to have run previous examples for later ones to work, is another source of confusion. It should be easy to set things up so that dependencies are automatically, silently, run when an example is executed.

Additionally, some of the conventions used (such as the custom print and show functions) go against common idioms (they should be called console.log instead).

Add one or two practical chapters 5

A great way to learn about the small subtleties of coding is to see someone work through a project and comment on it. These would be chapters at the end of the book that use the knowledge from the rest of the book to undertake some interesting projects.

One thing I believe every programmer is served well by is some basic experience with parsing and interpretation of custom domain languages. I think a chapter that demystifies the basics of programming language interpretation, and teaches people to think in the direction of creating their own domain languages, would be a great addition.

Another attractive program would be another game, one with more advanced logic than the Sokoban clone. A real-time simulation of some kind would help illustrate performance trade-offs and complexity theory.

Alternatively, a full web application, both front and back, is enlightening to work through. Something mundane, like a multi-user sketch app, could work well.

Write a graphics chapter

With canvas, SVG, and CSS 3 (transforms, gradients, shadows), modern browsers are a decent platform for graphics programming.

To push aspiring JavaScript programmers in the direction of wonderful graphical feats, I'd like to add a chapter that outlines the various options for graphics on the web, explains what to use in which situation, and shows some examples of the things that are possible.

Hire an artist

A more professional cover and some illustrations would do a lot to liven up the book. The more I collect on this item, the more I'll be able to pay an illustrator to help me with this.

Second edition on paper

The publisher of the current edition, No Starch Press, have expressed interest in publishing a second edition.

This means that they will help with professional editing (which is sorely needed when a non-native speaker like me tries to write an English book), and put out a commercial paper version of the book.

Thank you,
Marijn Haverbeke