Hacker News new | comments | show | ask | jobs | submit login
John Resig's ‘Secrets of the JavaScript Ninja’ has been released (amazon.com)
160 points by simonsarris 1573 days ago | hide | past | web | 84 comments | favorite

I wrote "quietly" released in my original HN title (since edited by mods) because Resig neither made a blog post nor even tweeted about its availability, which seemed very odd to me, especially for something 4 years in the works.

He did write a bit about the status of the book back in July, if anyone is interested: http://ejohn.org/blog/secret-omens/

edit: John just tweeted: https://twitter.com/jeresig/status/285858421029347328

Sorry for the delay in announcing it - I was waiting for the book to physically arrive in my hands, which it hasn't done so, yet. (I have a copy pre-ordered with Amazon and since that's the way most people will be receiving the acquiring the book, I imagine, I wanted to make sure it was actually, physically, being distributed before I announced it.)

I plan on writing up a full blog post once I have my copy of the book.

John: Sorry, I just fat-fingered a down vote that was supposed to be an up vote. Thanks for checking in. I'm looking forward to the book myself.

Any plans for a kindle version? As I lives in an asian country (Sri Lanka) kindle is best and only way to access amazon book store :)

I assume you mean having the book physically shipped to Sri Lanka is not feasible/possible. Consider buying the ebook from Manning directly [0]. They do offer the ebook in Kindle (mobi) format.

[0]: http://manning.com/resig/

Once there's a pdf or other ebook available it'll be pirated. How that doesn't damage sales I'll never understand. The Lazarus (object pascal ide) book is only available in a physical book format for this reason.

It may well be pirated regardless:


In another life I wrote technical books, which at the time were only available in physical formats. That didn't stop electronic versions of the more popular books from appearing on usenet.

That's a good read. It's hard to understand the motivation of someone who's prepared to put in that many hours pirating a single book. It's seems a bit pathetic

> How that doesn't damage sales I'll never understand.

Because the people downloading it are not necessarily the same people who'd have bought it otherwise.

Plus exposure. I pirate a lot of stuff. At the same time I buy more books and music than anyone else I know.

Yes. Shipping to Sri Lanka is harder or takes too much time. Thanks. I will go for the manning site. It works

This blog post is worth reading. In it he apologizes for the book taking so long and expresses some regret for taking on the project in the first place:

"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."

Procastination 101

Makes me kinda hate the book since he was such an awesome blogger. :(

Aww. I really want to start blogging again, in ernest, this year. I loved all the old blog posts I did - would love to do it again!

I suppose a true ninja never announces himself.

4 years ago that title would have been awesome too

I think it is a good title for 2012/2013 also. They could have called it "Barf" though, and I'd be excited about it.

Considering the date, it seems as if it might've been pushed out the door to satisfy contractual obligations.

I'm not sure just how relevant it will be, now that the JS ecosystem has exploded -- seriously, 4 years is _eons_ in the JS world, I think the Jaxer server was still the new tech and NodeJS wasn't even heard of at the time -- and there are 10x's as many JS devs now than there was in 2008 (not to mention that the average competency seems to have greatly improved as well). And I could be wrong, but I think he's mostly disconnected from jQuery itself now, too; I'm clumsy with git/github, but I can't even find his last commit to jQuery, and I know that all of the blog posts on jQuery.com have long since been done by other team members. While he's a really talented dev, his name is pretty rare when it comes to JS news and topics these days.

I definitely agree that there are a ton more JavaScript users now, compared to 4 years ago - I disagree that they're more competent, it's a pretty massive bell curve. The tech bubble can be pretty insular here at Hacker News but I still run across TONS of people who've never 1) Used any JavaScript whatsoever or 2) Have used a JavaScript library but have no concept of how it relates to JavaScript, the DOM, or what the library does under the hood. The book attempts to serve #2 primarily and that's still a MASSIVE audience.

As to being involved in the JavaScript world, my focus has shifted - I'm no longer trying to build tools for people who already have tools, I'm trying to teach the next generation of developers and JavaScript users: http://ejohn.org/blog/introducing-khan-cs/

I also feel extremely confident that the technical work that I've done with the Khan Academy CS platform continues to be unlike anything else done by other development platforms.

Thank you for your Computer Science work on Khan Academy! I tech my kids using your system for several months now, and I am very happy! :) Would be great to be able to change the rendering size from 400x400 to something bigger, may be even having a splitter in the middle, and deciding how much you want to use for the editor and for the program :)

Happy New Year!

Aye, perhaps it's my perception then, because I've been seeing lots of awesome code out there recently. There used to be a few exciting JS projects, though many of them were redundant in some ways, and they were still fairly basic by today's standards. Today, though, it seems like a fun new project pops up monthly.

I won't argue that there isn't still a ton of education that needs to happen! I've been battling this at work, as few candidates have much JS experience at all (I think all of the good ones are involved in the hot projects).

I'd also concede that educating future coders is possibly not only more important, but more fulfilling. I've been following your blog for awhile, and though I do miss the geeky JS topics such as the precision (or lack thereof) of setInterval/setTimeout, how great documentFragment's are, etc. I've also enjoyed the posts about Kahn.

I think it's an issue of there being a bell curve on all the JavaScript users. If we assume that 80% of JS users are in the "use a library and know very little of the language" category and the top 10% is "publishes libraries/tools" and the bottom 10% is "copies-and-pastes code with reckless abandon" - then going from 1 million JS users in 2008 to 4 million now (theoretical) then there will be 4x more awesome libraries and 4x more ignorant users.

Thank you for the kind works regarding my blog - I really hope to begin writing again. Perhaps that'll make for a good new years resolution :)

Definitely more awesome code out there but I think you're seeing that from a VERY vocal minority of developers who are 1) very vested in the OSS community, 2) love to share code and 3) are pushing to get the most out of JavaScript.

As I think John eluded to, there's a number of developers that don't fall into any of these buckets and a book like this would certainly be useful to them. I was with John on the jQuery team and I know that I'll be picking up a copy of this since I'm sure I'll find some nugget of awesomeness in there that will make it worth the price.

I agree, I used to get excited about just jquery plugins. But noe using node.js and ember.js makes me almost not want to code in anything else. (Except for objective-c for ios and java for android)

It is just amazing to see how much it has exploded in the last few years. Serverside js and client side mvc will keep me excited at least for another year.

They've probably been revising it as JS has progressed.

Perhaps, but lacking a formal ToC and using the "review" that's listed on Amazon, I'm not seeing any indication of:

    * ES5
    * CommonJS
    * promises/deferreds
    * AMD/UMD/etc.
    * NodeJS
    * asynchronous concerns such as callback hell (and other focus areas as addressed by Async.js[1])
    * packages
    * HTML5
    * the MV* hysteria
Granted, many of those aren't central to "JS" proper, they should at least bear a mention....but perhaps not. Just seems like what's covered is mostly run-of-the-mill JS fodder...

1. https://github.com/caolan/async#readme

There is no coverage of any of these at all. I really think the book is an overview of cross platform javascript issues from 3-4 years ago that someone who wanted to clone jquery would need to know. That is about it. I am really disappointed at the lack of progress throughout the MEAP stage. I hoped it would develop into more advanced areas but it must have been hard for the authors to change focus especially after years of writing the book.

I don't think it makes sense to shift the focus of the book - the topic that it serves (understanding the fundamental construction of JavaScript DOM libraries and the trickier aspects of the JavaScript language) is one that is grossly underserved. The issues that jQuery tackles are still issues that are relevant to developers on the whole. I should note that while the book does tackle cross platform issues that isn't exclusively what it tackles - at least 1/2 of the book is on nothing but the JavaScript language, for example.

> [...] an overview of cross platform javascript issues from 3-4 years ago that someone who wanted to clone jquery would need to know.

Ugh! I have his prior book, Pro JavaScript Techniques (Apress, 2006), and that's basically how I've always described it. I refer to it as 'The jQuery Memoirs'.

I wouldn't consider Pro JavaScript Techniques to be "The jQuery Memoirs" really at all. It only mentions libraries in passing. Whereas this book is much more in-depth and really breaks apart the fundamental aspects of a JavaScript DOM library in a way that developers can put into common use.

It may only mention libraries in passing, but I seemed to remember that many of the techniques were used in jQuery (where applicable). I don't mean any offense by relating that to memoirs; rather, it was very helpful to see many of your examples in real-life code that I was using every day -- and finally understanding both the how and the why.

Thanks for the reply, and good luck with the book! I do plan to check it out.

Oh, no worries - hope you'll enjoy it!

A couple of those items show up in the index that's available on the Manning site, and the preface that's available there addresses them a bit too. Also implies that most of the revisions weren't made by Resig but by the coauthor...

I can confirm that there is very little coverage of these topics -- perhaps a bit about ES5, but I've read the MEAP, and I don't recall reading anything about the rest of them.

asides from ES5 and promises , none of these are core javascript issues. NodeJS is not javascript , CommonJS what the hell is that ? nobody cares about that stuff , HTML5 is a set of apis , nothing to do with javascript , If i want a book on javascript i want a book on the language itself , not on canvas , webgl, requireJS or Express or Backbone ...

> asides from ES5 and promises [...] CommonJS what the hell is that ?

Perhaps you should learn what you're criticizing before you criticize it; CommonJS has put forth a lot of effort to try and standardize API's across platforms (browser, server). API's for things like...promises[1]. And modules, plus many more[2]. Ironically, several of these could very well end up in ES Harmony, and so to discuss them now wouldn't be too much of a risk because the problems they solve exist today.

1. http://wiki.commonjs.org/wiki/Promises

2. http://www.commonjs.org/specs/

> NodeJS is not javascript [...]nobody cares about that stuff , HTML5 is a set of apis , nothing to do with javascript

Yes, but if you work with JS in any capacity today, then there's a good chance you'll be working with either or both of those technologies.

> not on canvas , webgl, requireJS or Express or Backbone

I didn't mention any of those...

Core or not, I'd prefer coverage of those issues myself. I can't really think of core problems I run into myself, I've been writing core JavaScript for a decade or something, but there's lots of intricacies with those other things where I wouldn't mind tips. Different audiences, I suppose. I browsed the TOC one kind reviewer was nice enough to list, saw there wasn't anything I was interested in or had trouble with lately, and moved on.

False, you want a book plus its applications; if you buy a book about woodworking you probably want to see some examples of furniture creation and other practical challenges to apply your new found knowledge.

That is why this book deals with DOM and BOM from chapter 11 to 15 even if those are not purely JavaScript.

Interesting choice of a samurai for the cover image, considering the book's title.

SIGH. I've tried really hard to get this changed. Outside of my control, unfortunately.

The ninja is hiding behind the samurai, naturally.

So I don't have to be a Ninja or a Samurai to get anything out of this book? ;-) Awesome.

The title still sucks. I don't get this idea of (ninja|rockstar|etc) and it's extremely disrespectful to those that practice those disciplines.

I hope your last sentence was a joke

Not at all. The disrespect comes from the stupidity of the title and people making it. Rockstar? Ninja? Evangelist?


How about Shaolin Monk JS? Hung Ga JS? Hung Fut JS?

Is the absurdity getting through your brain yet?

And if you're talking "Evangelist," where the fuck is your church?

I think you're wrong. Unless you want all books to be called 'How to be really good at...' or equivalent, then people have to try to be original to some degree which includes using words in new contexts.

I looked up ninja (http://zillyninja.blogspot.ie/2011/02/origin-of-word-ninja.h...) and apparently it can mean "a person skilled in stealth" or "one who endures." while the ninja themselves were spies for the samurai but haven't been around for a long time (http://web-japan.org/kidsweb/explore/history/q4.html).

I guess that you'd have no problem if someone called their book 'how to become a javascript expert'. Expert comes from the latin word expertus ( past participle of experīrī to try, experience) (http://dictionary.reference.com/browse/expert?s=t) and presumably someone had to import it to english and later on someone else used it in a new unorthodox way.

BTW I looked it up and the word evangelist comes from greek and means 'bearer of good tidings', so it isn't something that has to be tied solely to religion

It's not about etymology, it's about people adopting silly phrases for common terms that already exist simply to try to appeal to emotion. Rockstar developer? Really? Would a Boy Band Developer count?

If you want to do that, go write fiction. If you're as adept at writing in the English language as Anthony Burgess or James Joyce, you can feel free to even make up words as you go along, not just new uses for existing words.

According to http://en.wikipedia.org/wiki/Ninja#Outerwear

"Clothing used was similar to that of the samurai, but loose garments (such as leggings) were tucked into trousers or secured with belts."

Ninja, however, most definitely did not wear flags on their backs, as the fellow on the cover is doing.

The purpose of those flags is to signal who and where you are. Neither of those goals aligns very well with what ninja do.


Probably just trolling the pedantic. Looks like it worked :)

it was discussed in pre-publishing feedback site. But it was over 2 years ago and I don't even remember how the discussion ended lol.

I bought the MEAP a long time ago (allows you to read chapters as they are released...before edit), and I've casually read along. At the time, JS was not a strong language for me; I've put in the effort to reverse that. The main approach (which I liked): a) explain a topic in text b) illustrate with code c) test code => QED. If you're novice/intermediate with the language, I think it may help explain some of the trickier things. My main critique was that I did find some of the text overly verbose. My favorite book is still Stoyan Stefanov's http://www.amazon.com/JavaScript-Patterns-Stoyan-Stefanov/dp... and I've read nearly all of them at this point.

I purchased this book as a MEAP (Manning Early Access Program) in august 2008. Never expected it to take this long.

Yep. Feels like a quick cash-grab on a piece of work that's beta, at best.

I preordered it and am supposed to receive it wednesday. I'm excited to go through it. Note that you can get the ebook through the publisher if you buy the print version on Amazon.

Publisher's website for the book: http://www.manning.com/resig/

You can order it through them rather than Amazon to get the eBook directly.

Use promotional code "bestof2012" to get it half off. http://archive.constantcontact.com/fs172/1101335703814/archi...

Worked perfectly, thanks! Total with shipping was $25.24. The price without shipping is about the same on Amazon.

Shipping is free on Amazon, but Amazon's price that I see is $25.77 so you're still saving a few cents.

thanks for this, $15 for the ebook == immediate purchase

I pre-ordered this book when it was first announced. At the time I was a JS novice and now I'm quite accomplished. Hoping there's still something useful to get out of it.

I've grown so dependent on Kindle that if I don't find a book on there I never bought it. I've waited years for the release, I'll wait a bit more for the kindle version.

On a similar vein: http://www.scottisheyes.com/walled-gardens

I wish authors would produce for various platforms, rather than targeting just one, even if it is the de facto market leader.

Edit: of course after I posted this, I see that it is available in PDF format from Manning's site: http://www.manning.com/resig/

The EPUB and Mobi formats usually come a few days after the print release. You'll get them automatically.

"Amazon Best Sellers Rank ... #18 in Books > Computers & Technology > Programming > Java" [sic]

Ouch! For John's sake I hope Amazon gets the category corrected.

It's mostly automated, as far as I can tell. I've seen the same book ranked top ten in both fiction and non-fiction.

That's not necessarily inaccurate.

Though something tells me you weren't looking at the Bible.

depends-on-the-reader-if-fiction, a new category in amazon's book.

It's been so long that I'm not sure if I bought it already or not.

Is there a digital version?

See the comment thread below. You can buy an ebook direct from the publisher, or get it from the publisher with purchase of the physical copy

It's a shame that the price is so onerously high. I find that this is a common trend among technical books: they are often made inaccessible by their prices. Even if a small subset of the market is willing to shell out, such high prices probably alienate those that would most benefit from these books: novice programmers.

The fact that writers can and will sell to a niche audience willing to part with a lot of money ultimately leads to a field sparsely populated with accessible topic literature...

Like so many others, back in 2008 when I bought the MEAP all I really knew was alert("Hello!"); and associating onclicks inline to DOM elements.

It's a good read though, and now that it's finally released, I'll take a look at it again.

The JS ecosystem has changed a lot though, but this book, if I remember it correctly, explains a lot of the rationale of why it's good to program JS a certain way.

"Usually ships within 1 to 2 weeks."

I guess I've been spoiled by the grace of the past 10-15 years of technical book buying, but that is insane.

Books whose titles contain elements of the set "secret", "ninja", "rock star", "days", "master", "dummies", or ones that have a number in the title (2012, 24, etc) really put me off. I know I shouldn't judge a book by its cover, but these titles are really hard for me to take seriously.

I agree. These terms are devoid of meaning and are really grating.

A book takes a long time to write. How do authors test the market for a book before sitting down to type?

Did we ever come to a decision what's better, the "Ruby Rockstar" or the "Javascript Ninja"? One has the alliterative benefit, the other might have Real Ultimate Power.

Side Note: It's now 2013 and we're still doing that.

I can't remember the last time I ordered a book that didn't have "Search Inside This Book" enabled by its publisher.

I read his "Pro JavaScript Techniques", which felt rushed and was full of (minor) errors.

Happy pre-subscriber of the ebook version for years now.

Congrats on finishing it. Book writing is hard.

Any review of it yet?

So I have to be a Ninja to benefit from this? What about people in other martial arts disciplines. It seems quite prejudiced.

That said, despite the retarded title, I have no doubt that Resig has some good secrets to share. Mad respect for a brilliant developer with a terrible editor (book editor not vim).

To clarify, such titles as "ninja," "samurai," "rockstar," etc. that are completely ridiculous are quite disrespectful to those who practice the arts that they make reference to.

Not to mention idiotic.

Guidelines | FAQ | Support | API | Security | Lists | Bookmarklet | DMCA | Apply to YC | Contact