TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Your jQuery: Now With 67% Less Suck

23 pointsby moreatiover 13 years ago

1 comment

jandyover 13 years ago
These are some good optimisation tips.<p>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.<p>Specifically, I'm thinking of the selector optimisation.<p><pre><code> $('#id').find('p') </code></pre> may be faster than<p><pre><code> $('#id p') </code></pre> 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.<p>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.<p>I think I made a point in there somewhere.