Previewing My Forthcoming JavaScript Book

March 15, 2011

For years and years now I’ve thought about writing my own JavaScript book. The idea started because many readers requested that I write one, hoping to read a JavaScript book that teaches that language as directly, and in as simple terms, as can be found in my PHP books (apologies for how egotistical that probably sounds). Of course, by now, pretty much every publisher already has their own JavaScript book. This, I believe, is part of the problem.

Most JavaScript books (and probably all that attempt to teach the language entirely) were first written in the late 1990’s, when JavaScript was mostly used for annoying and tedious tricks, such as alert boxes, status bar scrolls, and so forth. A decade ago, image rollovers and basic form validation were about as good as JavaScript got. Because of JavaScript’s own poor usage, any book written about JavaScript at the time was limited as to how good and useful it could be. Readers who appreciated my PHP and other books would often ask if I had written a JavaScript book. After saying “No”, they then would ask what JavaScript book I could recommend. For the most part, I couldn’t recommend many (the “JavaScript: The Definitive Guide”, written by David Flanagan and published by O’Reilly is one of the better ones, but like most O’Reilly books, is much better as a reference guide than an instructional book for beginners).

JavaScript today is a vastly different language, primarily because of how it’s being used, than the JavaScript I first learned in the 1990’s. Ajax, more consistent browser support, and the rise of frameworks are just three reasons JavaScript has evolved into such a useful, worthwhile language. In fact, JavaScript today is an important language to know. Over time, the original books on the language have been updated and updated to acknowledge these changes, but the results are largely kludge-y texts. My desire is to write a JavaScript book that teaches the language itself, as it is today, without all the deadwood that’s long since been left behind (and thankfully so).

There is one publisher that does not have its own JavaScript book, though, and in 2009 I spent a couple of months discussing my proposed JavaScript book with them. Perhaps we could have made that happen, but for many reasons, I eventually decided it was not a good fit and ended the conversation. This still left me with the desire to do a JavaScript book, readers interested in said book, and an outline of what that book might look like. As I’ve been meaning to get into self-publishing for some time, this JavaScript book seemed like the right topic to test the waters. I’ve been thinking about this book for two years now and am actively working on it now, I’m happy to say, and feel confident enough with how it’s progressing to start formally speaking about it. Here’s my approach…

There is a quality of the JavaScript language that is simultaneously both a strength and a weakness: it’s easy to use. Without really knowing JavaScript, you can probably search around, find some code, and cobble together something that does what you need done. In the book I aim to both embrace this attribute, and build upon it: while the first criteria is getting something working, at the end of the day, most of us would prefer to know why it works. The book will teach everything you need to know to understand and use JavaScript, including the most important aspects of what JavaScript is today. There will be tons of real-world code, demonstrated in both hand-written JavaScript and using one or more JavaScript frameworks (while frameworks are a great, reasonable way to quickly accomplish what you need to do, you ought to have a good understanding of JavaScript aside from the frameworks). In a subsequent post, I’ll provide the current table of contents.

I’m hoping to have the book available by this summer and will distribute in both print and electronic formats (PDF, Kindle, and ePub). The electronic formats will not use DRM and most likely a purchase will qualify you for free updates of future revisions. The prices will be determined later on, once I have a better sense of cost, but expect the price to be somewhere between $10 and $20 (US). I may even do a Radiohead thing and let people pay what they want for it. We shall see. I will likely also put the entire content available online in HTML format.

I began actually writing the book recently and have about 6,500 words, constituting rough versions of the first three chapters. I’m writing the book on a Mac using Scrivener. I’m writing the book using MultiMarkDown. Between the amazing capabilities of Scrivener and MultiMarkDown, I’m going to be able to write the book once, and easily output it in every format I need.

And now, I’m going back to writing! I’ll continue to post updates both here and in my newsletter. My thanks to everyone for their interest in this book and my other work.