Hacker News new | ask | show | jobs
by jblok 4272 days ago
Those are all sites that have been around for ages though, and jQuery is quite hard to remove from a site once it is embedded in. Anyone creating a serious web-app from scratch now really shouldn't be using jQuery, but one of the alternative set ups mentioned above.
2 comments

I disagree. AngularJS uses jqlite underneath for lots of stuff it does with the DOM. It can use jQuery if it's included, and if you create your own directives, jQuery is a great tool. No, you shouldn't create a single page app based on bare jQuery. Yes, you should use jQuery for manipulating the DOM vs the native DOM manipulation functions.
They wouldn't remove it even if they had the choice, because recreating what jQuery does with regards to cross-browser compatibility is just wasting everyones time. I'm not saying it has to be jQuery, but since everyone is already familiar with jQuery and it works well - why not jQuery? Eventually yes I think we can drop jQuery in favour of native implementations, but most sites can't afford to lose that compatibility yet.
Because it's not built for complexity? Maybe I'm a jQuery newb, but trying to built a tight app with it seems like a painful process. Sure, it's easy to build some quick tricks with it, but I'd hate to maintain a large project with a lot of it embedded.
I honestly can't see how jQuery dictate how you architect your code. jQuery is a DOM manipulating library and AJAX library. It is not a framework. It doesn't force you to organize your code in any particular way. You know that jQuery is not forcing you to not write everything in a single main function, right?

So I fail to see how using $('#...").foo() in your large project is going to be harder to maintain than rolling your own DOM manipulating library.

If all I'm doing is domConstruct.put() instead of $().append() then of course you're right. Dojo in addition to browser normalization and other good things that jQuery does, suggests a structure that works pretty well. jQuery to my knowledge does not.