

Your jQuery: Now With 67% Less Suck - moreati
http://24ways.org/2011/your-jquery-now-with-less-suck

======
jandy
These are some good optimisation tips.

I'm a little torn with some of them though; they're optimisations, and I don't
think you should necessarily do them all by default.

Specifically, I'm thinking of the selector optimisation.

    
    
        $('#id').find('p')
    

may be faster than

    
    
        $('#id p')
    

but to me, the latter is more idiomatic jQuery. Why that matters, in my
opinion, is the latter is much more likely to be optimised by the jQuery
because it's the default way most people write selectors.

There's nothing wrong with optimisations, and developers should certainly know
what's happening behind the scenes, but what's true today might not be true in
6 months time.

I think I made a point in there somewhere.

