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

Anyone who isn't using jQuery because "modern sites usually depend on browser native dom methods" is just being an asshole, honestly. If most big sites are using it, you can use it. I just checked: Twitter, Outlook.com, Stripe, Paypal, Pinterest, GitHub, Amazon, LinkedIn, Ebay, Tumblr, etc. The list goes on pretty much forever.


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.


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.


This doesn't make one an asshole; native dom methods can handle most of what people normally use jQuery for nowadays (even with the same function signature) so unless someone needs to do something more specialized I am not including an additional dependency.


People are assholes because they prefer and use or don't use other libraries over a popular one? What?


I would always encourage using a library over not using one - if you're not using a library you're just going to end up making your own anyway to "save time" - might as well start with something everyone already knows. If your project is also going to be something that a lot of people touch, you don't want to be using your own solution or a lesser known solution just because it's neater - that would be a waste of time.

So yeah, in my opinion if you opt to use your own solution or a lesser known one, I'd say you're at least a bit of an asshole because 1.) you're assuming you know better than the majority of people (who don't have a problem with using jQuery) or 2.) you're wasting everyone's time by forcing them to learn something new when there's a perfectly fine solution already available.




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

Search: