Jeff Atwood wrote up a post today on the merits of writing a technical book in this day-and-age and specifically called out my past post on programming book profits and my work-in-progress Secrets of the JavaScript Ninja.
I wanted to give a brief status update on the book and how it’s going. I started the book in early 2008 and was actually quite productive, finishing nearly the entire book that year (with some missing gaps that I fixed up in 2009). There was some work left to do to make it a better book but, honestly, I got caught up in coding and stopped focusing on writing. I had to prioritize my time and I chose to prioritize doing more development and focusing on my personal life. Some time last year Manning brought on a co-author, Bear Bibeault, to finish the book and get it out the door. He’s done a bunch of revision bringing it up-to-date and just the other week I finally wrote the preface. It’s in final revisions now and should be out-the-door very soon. This is a huge relief for me and it’s great that there’s one less thing to worry about.
To the point of Jeff’s post, I would absolutely not write a technical book again. It’s a tedious process and unless you LOVE writing and are really good at it (like Nicholas Zakas or Dave Flanagan) then I suggest that you stick with the medium that is truly successful: Writing long-form articles/blog posts and possibly spinning them off into purchasable ebooks. (As an example, I’d point to Juriy Zaytsev and Peter-Paul Koch both of whom could get any JavaScript position in the world purely based upon the quality of their articles and sites, without ever having written a book.)
I realized at some point in late 2008 that that’s really what I should’ve done with Secrets of the JavaScript Ninja but I was already neck-deep in the book with most of it complete. Ironically working on the book (or not working on it, however you look at it) actually compelled me to NOT blog more as every time I wanted to write a technical blog post I was forcing myself to make the decision “I’m writing about 1000 words on a technical matter, shouldn’t this just be going towards my uncompleted book?” and would just end up writing nothing as a result.
I do feel bad for, and apologize to, the people that pre-ordered hard copy version of my book over the years only to have to wait on a time scale comparable to George R. R. Martin’s writing schedule. Amusingly the book has been extremely successful as a pre-order e-book at Manning.com – it’s the best-selling MEAP book of all time. I’ve gotten numerous emails from readers who’ve gotten enormous benefit from the book, even in it’s rough form, and this has pleased me greatly.
I’m excited to finally have this book be out in the “wild”, as it were. It’s no longer (as Jeff put it) “permanently unfinished”.
I’ve included the preface from my book below, to give some more detail:
When I started writing Secrets of the JavaScript Ninja four years ago, in early 2008, I saw a real need: There were no books providing in-depth coverage of the most important parts of the JavaScript language (functions, closures, and prototypes) nor were there any books that even attempted to cover writing truly cross-browser code. Unfortunately it appears as if the situation has not improved very well, which is truly surprising.
More and more development energy is being put into new technologies (such as the ones coming out of HTML 5 or the new versions of ECMAScript). There isn’t a point to diving into new technologies, or using the hottest libraries, if you don’t have a proper understanding of the fundamental characteristics of the JavaScript language. While the future for browser development is very bright the reality is that most development needs to make sure that code continues to work in the majority of browsers and for the majority of potential users.
Even though this book has been under development for a long time, thankfully it is not out of date. The book has been given a solid set of revisions by my co-author Bear Bibeault. He’s gone through and made sure that the material will continue to be relevant for a long time to come.
A major reason why this book has taken so long is largely due to the experience that I was drawing upon to write the material for the later chapters on cross-browser code. Much of my understanding of how cross-browser development happens in-the-wild has come from my work on the jQuery JavaScript library. As I was writing the later chapters on cross-browser development I realized that so much of jQuery’s core could be written differently, optimized, and made capable of handling a wider range of browsers.
Perhaps the largest change that came to jQuery, as a result of writing this book, was a complete overhaul from using browser-specific sniffing to using feature detection at the core of the library. This change made it so that jQuery could be used almost indefinitely, without assuming that browsers would always have specific bugs or be missing specific features.
As a result of these changes jQuery directly anticipated many of the improvements to browsers that have come during the past couple years: Google released the Chrome browser, the number of useragents have exploded as mobile computing has increased in popularity, Mozilla, Google, and Apple have gotten into a browser performance war, and Microsoft has finally started making substantial improvements to Internet Explorer. It can no longer be assumed that a single rendering engine (such as WebKit or Trident, in Internet Explorer) will always behave the same way. Substantial changes are occurring rapidly and are spread out to an ever-increasing number of users.
Using the techniques outlined in this book, jQuery’s cross-browser capabilities provide a fairly solid guarantee that code that you write with jQuery will work in a maximal number of browser environments. This guarantee has led to explosive growth in jQuery over the past four years, with it now being used in over 57% of the top 10,000 websites on the Internet, according to Builtwith.com.
The portions of this book that cover features that are relatively un-changing, such as code evaluation, with statements, and timers are continually being used in interesting ways. There are now a number of active programming languages that are built on top of, or compiled to, JavaScript: Such as CoffeeScript or Processing.js. These languages require complex language parsing, code evaluation, and scope manipulation in order to work effectively. While dynamic code evaluation has been maligned due to its complexity and potential for security issues, without it we would not have had the CoffeeScript programming language – which has gone on to influence the upcoming ECMAScript specification itself.
I’m personally making use of all of these features, even today, in my work at Khan Academy. Dynamic code evaluation in the browser is such a powerful feature: You can build in-browser programming environments and do crazy things like inject code into a live runtime. This can result in an extremely compelling way to learn computer programming and provide all sorts of capabilities that wouldn’t be possible in a traditional learning environment.
The future for browser development continues to be very strong and it’s largely due to the features encapsulated in JavaScript and in the browser APIs. Having a solid grasp of the most crucial parts of the JavaScript language, combined with a desire for writing code that’ll work in many browsers, will result in your code being elegant, fast, and ubiquitous.
Hector Parra (July 11, 2012 at 2:19 pm)
Wow! I don’t even work with the employer I ordered this book thru anymore. I have to order it again. :)
You may have found that the concept of “treeware” is on its way out and that writing from any expert, in any form, is going to be useful to somebody. I found the unfinished MEAP extremely useful and educating. Hopefully there is some sort of middle ground that publishers will begin to offer that will benefit both writers & customers in our dynamic field. HGPA
TVD (July 11, 2012 at 2:33 pm)
Congratulations John and Thank You for your leadership on jQuery all these years!
Your belief in combining competency with compassion for cross-browser development is at the heart of innovation that lasts. Through-and-through this belief shined through jQuery and WE were all better developers for it.
The future of browser development is indeed very strong. And you’re absolutely right that the rich features of JavaScript and maturing browser APIs have much to do with this strength. But, I believe there is another factor, a more seminal factor, that needs to be acknowledged…
People like you…
People with a deep passion and love for JavaScript. So much passion and love for the language that it overflows and touches the many. Leaving in its wake valleys of progress and fertile plains most ripe for innovation.
So Thank You John! Thank you for everything!
Philippe (July 11, 2012 at 2:57 pm)
Hi,
I bought the ebook early in the MEAP. It was very helpful for me to clarify basics of javascript.
It was and it is still the best resource I red about principles of Javascript.
thank you both for your work.
Best reagards,
Philippe
James (July 11, 2012 at 3:12 pm)
John, I just want to say your javascript ninja book is the best javascript book I’ve read. This book and Javascript:Good Parts are the only two books I regularly refer to during development(other than google searches on random questions). Although I understand that it was difficult to write this book, I know many folks out there and especially myself are very grateful that you took the time to write it.
I look forward to reading your technical blog posts when you begin to have more time.
JGarrido (July 11, 2012 at 3:55 pm)
Ssooooo… when’s your next blog post? ;-)
Salman (July 11, 2012 at 4:09 pm)
I have had my eye on this book for a while, good to know it is coming out soon.
BTW, it is the best selling MEAP but it could also be the longest running MEAP :)
Steve (July 11, 2012 at 4:10 pm)
yes, more blog posts! :-)
justadude (July 11, 2012 at 4:16 pm)
nice …
the thing with MEAP is that they don’t give a shit (excuse my french), and the more I buy their books, the worse it gets…
this guy (japhr.blogspot.com) wrote 3 books, just like writting blog posts.
\js (July 11, 2012 at 4:24 pm)
i agree completely with what you are saying about blog posts and books, but ppk *has* actually published a book:
https://www.powells.com/biblio?isbn=9780321423306
figital (July 11, 2012 at 4:48 pm)
I should find out if I can update my shipping address. I ordered that thing a few jobs ago. ;) Hopefully it’s gotten a few extra nice rounds of QA because of the online MEAP access. It surely is amazing how different the context is now vs 2008.
Mickey Mouse (July 11, 2012 at 6:57 pm)
Dear John,
I think it’s safe to say everyone can just ignore Jeff Atwood.
He’s the frustrated type.
Other than that, good luck with your book.
Michael Mahemoff (July 11, 2012 at 7:14 pm)
The harest thing about writing a book is the last-mile problem, that’s what gets the most tedious part.
To be clear, about PPK, while his blog posts are indeed excellent value, he also has written a book (of similar quality) http://www.amazon.co.uk/ppk-JavaScript-Voices-That-Matter/dp/0321423305
Michael Mahemoff (July 11, 2012 at 7:16 pm)
hardest* (thanks iPad)
julian (July 11, 2012 at 7:20 pm)
I purchased the MEAP back in 2008 I think… nice to hear it’s finally a wrap, congrats!
Ric Johnson (July 11, 2012 at 9:21 pm)
John,
I bought your first book and got you to sign it at the Ajax Conference and you thanked ME for giving the domain Ecmascript.org to Mozilla. It was very exciting to meet you!
I am very glad your book is finally coming out – I ordered it years ago and always wondered why it was taking so long. I hope I can get this one signed too!
I have a question about Ecmascript.Next – will it be called JavaScript 2? How will we be able to deal with browser comparability when we are not test the DOM but the language features? Will the script tag need a version attribute?
Ric
Cymen Vig (July 11, 2012 at 9:48 pm)
I don’t mind at all as someone who pre-ordered via the MEAP a while ago. It looked like an interesting book and I got something out of the early access plus it’s nice to say thanks for your work somehow and this was one way. So thanks and don’t worry.
Sandy (July 12, 2012 at 3:45 am)
Finally
Tattoo (July 12, 2012 at 6:44 am)
Good to hear! Does this mean you are able to blog more? Your blog is one of my favourites and I have feeled sad that it’s not as active anymore
Subhra (July 12, 2012 at 7:44 am)
Hi Jon,
Nice to know that your book has ultimately finished . I am hoping it will take the Javascript world by storm .But at the same time it is sad to know that you too share the same feeling about writing a book like Jeff Atwood . We the readers will be deprived of your vaualble writing then . Once again congrats.
Regards,
Subhra
Jyoti (July 12, 2012 at 7:47 am)
You wrote ” It’s in final revisions now and should be out-the-door very soon”. So how long can we expect “very soon” to end ? I have been waiting for it since 2009!!.
Rey Bango (July 12, 2012 at 8:42 am)
Agree with you 100% on book writing, John. Many, MANY years ago I wrote one chapter of a cookbook-style book and felt like it would never end. Since that time, I’ve committed not to writing books.
With that said, it’s truly great that your book is completed. I’m sure it’ll be a hit. Congrats!
Jared Barnett (July 12, 2012 at 4:20 pm)
I was worried that the book would be outdated by the time it came out, so its great to get some reassurance that it won’t be. Thanks to Bear for his efforts and thank you for getting it out the door. That must be a great feeling. Now you can REALLY focus on your work and personal life.
All the best,
Jared
Ric Johnson (July 12, 2012 at 7:28 pm)
John,
I bought your first book and got you to sign it at the Ajax Conference and you thanked ME for giving the domain Ecmascript.org to Mozilla. It was very exciting to meet you!
I am very glad your book is finally coming out – I ordered it years ago and always wondered why it was taking so long. I hope I can get this one signed too!
I have a question about Ecmascript.Next – will it be called JavaScript 2? How will we be able to deal with browser comparability when we are not test the DOM but the language features? Will the script tag need a version attribute?
Ric
Greg Babula (July 13, 2012 at 12:09 pm)
I’ve been periodically reminding myself to check the status of the book since I ordered it a while back, glad to hear it’s finally coming to an end and I can’t wait to read the end product.
John Weis (July 13, 2012 at 12:50 pm)
I for one am half-way through the latest version of the MEAP and by far, it is *the* best JavaScript book I’ve read!
Thanks for doing the hard work to get it finished! It’s great stuff.
I’ve set up a small repo to run test things as I learn, if anybody wants to use it: https://github.com/weisjohn/secrets_js_ninja_notes and you can ivew it in action at http://weisjohn.github.com/secrets_js_ninja_notes/runner.html
Joe (July 13, 2012 at 12:50 pm)
You should have just released what you had. You wrote a good book a long time ago. The early version I read made me fall in love with JavaScript.
Steve Heffernan (July 13, 2012 at 12:59 pm)
I could never write a whole book myself either, but I did a video tutorial series on Lynda.com that was pretty enjoyable and profitable. http://videojs.com/lynda
So you might consider that option. I talked to some other authors there, including the author of the jQuery tutorial, who said they’d never go back to writing books.
PS. I learned a ton from JS Ninja. Cheers.
Adam (July 13, 2012 at 1:52 pm)
Well, if coders can be rockstars (and John, you’re pretty awesome) you should rename yourself as “Guns and Resig”, then re-title the book to “Chinese Democracy of a JavaScript Ninja”.
I think it has a ring to it.
Sanjay B (July 13, 2012 at 3:24 pm)
John,
The MEAP of your book is possibly the only “digital good” I have paid for in my life, and have not regretted it one bit. Receiving the updates has always been exciting and a pleasure, and the money spent on the MEAP has been worth every paisa. Also, of course, how can one regret buying something from the ultimate rockstar-programmer of the interwebs? :-)
Please do not feel guilty or bad for the delay, sir – you are a rockstar and it would just not be right if the book followed a “normal” procedure :-). Looking forward greatly to the next email from Manning saying there is an update – it will be a bit sad when the book is actually complete and there will be no more updates :(
Thanks again for everything you do.
Ross M Karchner (July 13, 2012 at 9:02 pm)
Off topic, but can you get manning to stop calling print books “pbooks”.
Thanks ;)
Ross M Karchner (July 13, 2012 at 9:03 pm)
Sorry, pBook
fpiat (July 14, 2012 at 6:48 am)
“Amusingly the book has been extremely successful as a pre-order e-book at Manning.com ”
I’m happy for you that you are amused by someone buying your book four years ago and still waiting a final version. Being this person, I am less happy to be taken for a fool.
Writing a book is not like writing software with never ending bug’s correction.
Barney (July 14, 2012 at 11:55 am)
Errata: PPK has written a book — and very good it is too: http://www.quirksmode.org/book/
Mike Ratcliffe (July 14, 2012 at 4:59 pm)
After been tech. editor for one Firebug book I decided to write my own but discovered that it took a huge amount of time that I didn’t have. I ordered your book in 2009 but I can completely understand why it has taken so long.
Congrats that it is so close to release!
Marcos Caceres (July 16, 2012 at 9:43 am)
Yey! Been waiting ages to read this! :) Congratulations John! And I hope to see “learn JavaScript” at the Kahn academy instead of learn Python (boo!!!) :)
kiranvj (July 17, 2012 at 5:34 am)
Waiting for your new book. Planning to buy frm Amazon. Ever since you started the work in 2008 lot of exciting things like HTML5 and new JS applications has emerged. Its very tedious process to update the contents and make the book the upto date. Good luck…
Seabook (July 23, 2012 at 10:56 pm)
Yong man with exceptional skills.