3 ms·
Always fall back to core JavaScript whenever possible. Limit framework usage. Why, frameworks exist for a reason and keeps us from reinventing the wheel. Many
by kls 16y ago
Always fall back to core JavaScript whenever possible. Limit framework usage.
Why, frameworks exist for a reason and keeps us from reinventing the wheel. Many times a contributor to a framework has labored to make his routine as efficient as possible on the broadest array of platforms. Many times we can forgo a lot of optimization work by using the framework rather than rolling our own.
- daleharvey 16y agoframeworks provide generic interfaces, a lot of the times they support wildly varying uses while you know exactly what you want to do $("#myid") vs document.getElementById("myid") for example, $() supports a vast amount of functionality.
- CoryMathews 16y agoThis article is about performance not ease of development. Frameworks are made to make development quicker and easier, but its at the cost of performance.
- boucher 16y agoGross generalization alert. True ever? Probably. True always? Absolutely certainly not.
- alexyim 16y agoRight. It depends on the framework too, jQuery is probably a good bet whereas a plugin built on top of them might not be. In any case, if you're concerned about performance, you should examine the source code of the framework anyways to see if it's doing anything unnecessary from what's required of your application.
- Kilimanjaro 16y agoAnd they are cached all over the web, try using google cdn whenever possible.
- synnik 16y agoTrue, for external sites. But for internal sites, storing my framework with my app lets my local web server cache it, instead of forcing users to traverse the network and go outside our firewall to Google's CDN.
- mrduncan 16y agoIn other words: Do you really think that you can write this piece of javascript better than John Resig? (substitute authors as necessary) In some cases, yes, but I'd argue that in most cases probably not.
- kls 16y agoThanks, you made my point better than I did.
- weixiyen 16y agoPerhaps he means why use $.each over native javascript equivalent.