
John Resig: Secrets of the JavaScript Ninja Update - shill
http://ejohn.org/blog/secret-omens/
======
javajosh
I really admire Resig, and this post contains a few gems:

1\. Knew about PPK[0], didn't know about JZ[1]

2\. Feature detection came about from writing this book! Which generalizes
too: writing is a great way to innovate (something pg has said, too).

3\. A nice little jab at GRRM, who thoroughly deserves it.

4\. An exciting glimpse into the future of computer science pedagogy by way of
JavaScript in the browser. (And I can't help but wonder if this is an oblique
response to the recent Alan Kay Dr. Dobbs interview, where Kay asserts, "The
Web, in comparison, is a joke. The Web was done by amateurs."[2])

5\. Points out that even the best of us can get stuck in a procrastination
loop.

6\. Resig is going to finish a JavaScript book [3]

[0] <http://www.quirksmode.org/>

[1] <http://perfectionkills.com/>

[2] [http://www.drdobbs.com/architecture-and-design/interview-
wit...](http://www.drdobbs.com/architecture-and-design/interview-with-alan-
kay/240003442?pgno=1)

[3] <http://jsninja.com/>

~~~
oinksoft
Regarding #2, regulars on comp.lang.javascript have been saying this since at
least 2008, notably in critiques of jQuery. Resig even posted to some of these
threads defending jQuery's misbehavior (though I don't recall if he defended
browser sniffing). I find it very surprising that it took the act of writing a
book to realize this fundamental design flaw. And for those who will want to
say "oh, that's just because David Mark is so grating," quite a few mild-
mannered regulars reached the same conclusion, so it's not as though there was
one firebrand suggesting this.

~~~
gilini
Also, here's Resig's take on feature detection circa '07:

"Yawwwwnnnnn.... this is, quite possibly, the most inane set of ramblings set
up by someone who has obviously never created a JavaScript library of any
kind, nor has used JavaScript code in any sort of production environment."

[https://groups.google.com/d/msg/comp.lang.javascript/QVlJ0bz...](https://groups.google.com/d/msg/comp.lang.javascript/QVlJ0bzObmo/tftosTAr0lYJ)

    
    
        >> Do you have any idea how many agents jQuery will identify as IE?
        >The ones we care about?
    

I wonder why jQuery eventually turned to feature testing...

~~~
jeresig
I think that post has less to do with my opinions of feature testing and more
to do with the environment presented by that usergroup.

As to why jQuery moved to feature testing, we discussed that in the jQuery 1.3
release notes: <http://docs.jquery.com/Release:jQuery_1.3>

~~~
gilini
Well, you did respond to the code critiques after all, so that makes it about
jQuery's source.

But I do agree that your opinion was biased by the behavior of the people
participating that discussion (if that's what you meant). Nonetheless, IMO, a
community leader should be able to deal with criticism, and I don't recall
reading personal attacks.

As of your link, I was being sarcastic.

~~~
jeresig
I wish I could say that I haven't been personally attacked by them,
unfortunately it has been rather extensive and ongoing. Thankfully I've been
able to avoid most of it by not visiting clj since 2008-ish and blocking
choice Twitter users. Sometimes is trickles back up to me from people letting
me know what's going on.

I'm 100% fine with code criticism - I think you'll find no JS library more
open to it than the jQuery project, we've shifted the code base many times
over the years making large quality/performance/API improvements based upon
criticism. That being said I have no interest in talking with people - valid
code criticism or not - if they're personally attacking me as well.

~~~
gilini
So you do agree that browser sniffing is a short-sighted method to test for
browser capabities and that clj has been preaching on it since 07?

I'm not judging or anything, but sticking around on clj and trying to argument
could have been very beneficial for both jQuery anc clj itself. There are ways
of ignoring people in usenet, you know.

Also, Juriy, whom you cite in the book's preface, was a regular there long
before his website really took off. That means you didn't dislike every member
;)

~~~
pbiggar
He just wrote a post about being attacked, and you attack him? (Perhaps I'm
misreading your tone, but it seems to be really aggressive)

~~~
gilini
I'm not attacking anyone (at least not on purpose), I'm just trying to make a
point here.

Resig's actions towards clj effectively turned his whole userbase against
everyone and everything that was written in that newsgroup. Thousands of
unexperienced js developers shunning great advice just because it came from
someone Resig had a beef.

I do believe that it had a negative effect on the javascript industry for a
few years.

~~~
javajosh
Yeah, JavaScript really hasn't gone anywhere since Resig left clj in 2008.

~~~
gilini
That's obviously not what I have said.

------
ck2
It's been so long I completely forgot I bought the book!

The best way to get a project done is to

    
    
       1. need the money
       2. not get paid until you finish
    

If either of those elements are missing, expect delays ;-)

------
danso
I've written a few short-ebook-like technical posts and it still surprises me
the number of people who ask for when the PDF format is coming... I get that
not everyone can have access to a web browser at every occasion they have for
reading...but the web provides a much better canvas for illustrating technical
concepts, especially with the ability to create interactive bits with JS. Save
the couch reading for leisure/non-technical reading, and read technical pieces
when you're on the computer (and have ready access to Google/StackOverflow).

On a selfish note, writing HTML seems to be much easier than producing a
properly formatted PDF page. So I enjoy technical writing, but not enough to
go through the hoops of for-paper (or paper like e-books) publishing.

~~~
why-el
I was actually thinking about this earlier. Why is pdf so hard to deal with?
And why is around in the first place? I can imagine a future where html5/js
combo is enough to convert a set of html pages to a nice offline-supported
readable format.

With that said, I usually just go to the print page of some links and read.
You will be surprised how many sites inadvertently give the best reading
experience through their printer page (NYT for example)

~~~
danso
I don't know if it's hard as I've never tried. But as I've tried a lot of ways
to print websites as PDFs, through various third-party services, I'm assuming
it's not at all straightforward...

I think the "hard" part is properly paginating things? And I guess generating
table of contents, inner-book-links, things that my blogging platform
(Octopress) handles in a way that I've been used to as a Rails templater.

~~~
peterarmstrong
We can import blogs and generate ebooks (PDF, EPUB and MOBI) at Leanpub. The
idea is that you should self-publish as you write, and that starting with a
blog is a great way to start. We generate a table of contents, support
crosslinks, etc. It may be what you want...

------
ville
I haven't read the book, but this praise of with statements struck me as odd:
"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 also seems to be even a whole chapter
in the book dedicated to with statements. What are those interesting and great
applications that justify this feature, being considered harmful[0] and even
removed from the language in strict mode of ES5?

[0] [http://www.yuiblog.com/blog/2006/04/11/with-statement-
consid...](http://www.yuiblog.com/blog/2006/04/11/with-statement-considered-
harmful/)

~~~
jeresig
Every where you see the "with statements are harmful"/"eval is harmful" drum
being hit, you see Douglas Crockford. He's a great guy, and I really respect
his opinion, but I continue to feel that these are legitimately useful aspects
of the JavaScript language -- especially if we want to consider JavaScript as
the "assembly language" upon which other languages are built.

For with statements in particular, templating and scoped evaluation (I provide
an example from the Firebug console in the book) are probably the two areas in
which I've seen it most successfully used.

For code evaluation I only have to direct you to the creation of Coffeescript
(an entirely evaluated language) whose innovations have directly influenced
new versions of the ECMAScript language.

They have their place and when used sparingly, but effectively, the can be
formidable parts of a web developer's arsenal.

~~~
jashkenas
I agree with what you're saying, but I'd also be remiss if I didn't quibble
with this bit:

    
    
        > For code evaluation I only have to direct you to the creation 
        > of Coffeescript (an entirely evaluated language) whose 
        > innovations have directly influenced new versions of the 
        > ECMAScript language.
    

The standard way to use CoffeeScript is to compile it to JavaScript first, and
then deploy and run with that. There's zero "eval()" involved. Or rather,
doing direct "eval()" of CoffeeScript is possible, and on occasion fun, but is
discouraged for all the usual reasons.

------
r00fus
John is a really great guy and has done (at least for me) more to advance the
knowledge of javascript than any other person I know.

Very fitting that he's now at Khan Academy.

I've personally bought the jsninja ebook for friends and myself because I
thought it was a great read and wanted to contribute to this kind of effort.

------
kevinpet
I was looking forward to learning how to do a javascript ninja update, which I
assumed might mean some kind of "reload the latest version of the JS while the
user is on the page".

------
cdr
While it's disappointing that it's taken this long for the book to get
finished, the publisher Manning has provided downloadable drafts throughout
the whole process - a great feature. Thanks to that I've had access to the
book (such as it's been) for pretty much the entire time, and that's what
pushed me to buy it when I did.

Can't wait till my paper copy ships - guess I better make sure my address is
accurate still :)

------
twfarland
Really respect that he chose to prioritise his personal life. Reminds me of
the lesson I learnt from Herbert and Harry as a child.
[http://www.penguin.com.au/products/9780140567830/herbert-
har...](http://www.penguin.com.au/products/9780140567830/herbert-harry)

------
anthonyb
Congratulations! Writing a book is insanely hard.

------
eswangren
Is a "JavaScript ninja" conceptually similar to a "my little pony samurai"?

------
cheap
Too bad I cancelled my order years ago...

~~~
cheap
What? The book is going to be great.

