Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

IE6 is below 5% market share. But if you absolutely have to support IE6, then yeah, use JQuery.

There are still some differences in modern browsers but those can mostly be repaired with polyfills.

Oh, and while I would not recommend doing your chaining operation (chaining just makes it harder to debug), I can write the same thing in one line of JavaScript:

      Array.prototype.slice.call(document.querySelectorAll('.something > *')).forEach(function(el) { el.className += ' bold-font'; });


Yeah sorry that one liner is pretty ugly. Also I don't see the issues with chaining and debugging. Chrome has a v.good debugger. And to top it off querySelectorAll requires ie8+.

Why not just use a extremely well tested library that automatically gives you full browser support? All for the equivalent price of one very small jpeg file.


> Why not just use a extremely well tested library that automatically gives you full browser support?

LOL. Which library would that be?


hehe just came back to check my comment history... dude u really created what 3.. 4? different accounts to reply to my messages?? Lol i really got under your skin. you are familiar with this right?

http://www.flickr.com/photos/villagemember/987251565/


Yeah sorry that one liner is pretty ugly

You had said that it was 10 - 20 lines of code. The reason I posted my original comment is that many jquery abusers don't know about alternatives.

Why not just use a extremely well tested library that automatically gives you full browser support?

You have to justify why you use something additive, not why not to use it.

All for the equivalent price of one very small script file.

Not quite sure why the load time of the script file gets so much attention. It is hardly to real expense of jquery. Many, many, many jquery-crutch sites are horrendously inefficient because they think that the magic of chaining and the robust selector language comes for free. It does not -- it comes at an often significant expense.


c'mon you know i meant that 10-20 lines are for an ie6+ solution.

You have to justify why you use something additive, not why not to use it.

If your decision not to use jQuery (or another lib that makes your life easier) is because of performance then you're optimising much too early.

Personally I optimise for developer time first and raw performance much further down the line.

And dom querying is not usually the bottleneck in most sloppy sites... its way too many event listeners. And jQuery comes to the rescue once again with extremely easy (to read and write) event delegation.

Sorry I don't mean to offend you or anything... but if you're rejecting jQuery or extjs or zepto etc. on the basis of performance then you're probably doing it wrong. Keystrokes count. Libraries allow you to focus less on plumbing. That's the whole point.


> If your decision not to use jQuery (or another lib that makes your life easier) is because of performance then you're optimising much too early.

LOL. That's the stupidest thing I ever heard. This is John Resig, isn't it? :)

> Personally I optimise for developer time first and raw performance much further down the line.

Yeah, you just set a new precedent. :(

> And dom querying is not usually the bottleneck in most sloppy sites...

You are allowed more than one bottleneck.

> its way too many event listeners. And jQuery comes to the rescue once again with extremely easy (to read and write) event delegation.

You just have no frame of reference.


> But if you absolutely have to support IE6, then yeah, use JQuery.

Absolutely NOT. The results vary per jQuery version as they have been struggling to grasp the subtle differences for six years.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: