Slashdot Mirror


JavaScript Devs: Is It Still Worth Learning jQuery?

Nerval's Lobster writes: If you're learning JavaScript and Web development, you might be wondering whether to learn jQuery. After nearly a decade of existence, jQuery has grown into a fundamental part of JavaScript coding in Web development. But now we're at a point where many of the missing pieces (and additional features) jQuery filled in are present in browsers. So do you need to learn jQuery anymore? Some developers don't think so. The official jQuery blog, meanwhile, is pushing a separate jQuery version for modern browsers, in an attempt to keep people involved. And there are still a few key reasons to keep learning jQuery: Legacy code. If you're going to go to work at a company that already has JavaScript browser code, there's a strong possibility it has jQuery throughout its code. There's also a matter of preference: People still like jQuery and its elegance, and they're going to continue using it, even though they might not have to.

20 of 218 comments (clear)

  1. Is it still worth it? by Anonymous Coward · · Score: 1, Insightful

    No

  2. jQuery is for lazy, fat, "developers" by Needs2BeSaid · · Score: 4, Insightful

    No. jQuery is bloated by their desire to make sure your pages are compatible with ancient Microsoft browsers.

    Also, jQuery allows developers to be very lazy. Example: Many sites bring back JavaScript in their AJAX returns. Did you know that jQuery uses EVAL to process any JavaScript returned via AJAX?

    jQuery UI is a horrendous memory and performance hog. There are billions of JavaScript code examples to perform the individual functions of jQueryUI without forcing your customers to download that monster.

    Don't be lazy.

    --
    Some things need to be said...
    1. Re:jQuery is for lazy, fat, "developers" by master_kaos · · Score: 1, Insightful

      Im not being lazy, im being productive. jQuery helps you get things done quickly. Could I get everything I needed done without it? Of course, but when I can get things done much faster with it, I will use it.

    2. Re:jQuery is for lazy, fat, "developers" by Anonymous Coward · · Score: 2, Insightful

      There are billions of JavaScript code examples to perform the individual functions of jQueryUI

      Billions of code examples to search and sort through that may or may not actually work, instead of one set of code that does most of what I need right now? And this is supposed to be an argument against jQuery?

  3. Don't forget legacy BROWSERS. by Ungrounded+Lightning · · Score: 4, Insightful

    A site may wish to continue using JQuery because some of its clients are using older browsers that don't support the new features that allegedly obsolete JQuery code.

    Drop the JQuery code and you drop those customers. Develop future code without it and the pages with the new features won't perform with people using legacy browsers. And so on.

    I've seen similar things happen over several generations of web technology. Use care, grasshopper!

    --
    Bantam Dominique roosters crow a four-note song. Once you've heard it as "Happy BIRTHday" you can't NOT hear it that way
    1. Re:Don't forget legacy BROWSERS. by PCM2 · · Score: 3, Insightful

      This is tricky. It's tempting to support legacy browsers, but if you do too good a job of supporting them, you don't incentivize your users to ever get their sh*t sorted, and upgrade their browsers. It's a vicious cycle I am eager to avoid.

      Yeah, but when your "users" are more properly called "customers" -- or even more important, "potential customers" -- then some web dev's desire to preach the gospel must take a back seat to doing the job the way it needs to be done, rightly or wrongly.

      It's fine to push for strict browser standards when the only people who will ever see your web applications are within your own organization. Public-facing sites are a different matter.

      --
      Breakfast served all day!
  4. JQuery is something to learn? by YoungManKlaus · · Score: 4, Insightful

    I always used it like "fuck it, I'm lazy, lets go"

    1. Re:JQuery is something to learn? by Tailhook · · Score: 4, Insightful

      Same here. $('select something').do_stuff(function (e) {...});

      That's about it. I don't feel as though I have some big investment there.

      --
      Maw! Fire up the karma burner!
  5. Uh... yes by ZipprHead · · Score: 4, Insightful

    That is, If you like frameworks that are bug free, extensively tested, universally known and hide a lot of the weirdness between browsers and browser versions providing a consistent interface, then yes, definitely learn it, it takes a lot of pain away.

    If you like pain, or always want to use the shinny new fancy thing, or want to learn all about IE9 and Opera edge cases. Then don't use it.

  6. Yes... by hyperar · · Score: 3, Insightful

    As long as the web is used to publish extremely complex apps that should not be on the web, yes. Web is for video playback, reading news and blogs, Business app?, desktop, using web services.

    1. Re:Yes... by Literaphile · · Score: 3, Insightful

      Web is for video playback, reading news and blogs, Business app?, desktop, using web services.

      2001 called, it wants its antiquated attitude back. The web evolves: deal with it. You bitching about what the web is now isn't going to make us all suddenly go back to "video playback, reading news and blogs".

    2. Re:Yes... by Pascoea · · Score: 2, Insightful
      Go find a new job then.

      Don't want to? Then shut up and go back to programming a web-app. The Internet as you know it evolved, sorry it ran you over in the process.

      Business app?, desktop, using web services.

      Yeah, because everyone in my company is parked behind a desktop all of the time. And there are no conceivable reasons why they may want to interact with a business system when they are't at their desk.

    3. Re:Yes... by SoCalChris · · Score: 4, Insightful

      Yeah, those are legitimate concerns with a web app. But pretending that developing a standalone app doesn't have its own set of equally painful problems is ridiculous.

      With a standalone app, you've got to worry about things like .Net versions, DLL hell, installation packages, keeping users up to date, windows versions, etc... Yes, modern languages will typically take care of most of this for you, but to pretend like they don't exist is just being naive.

  7. Yes by Anonymous Coward · · Score: 3, Insightful

    JQuery as a framework is, frankly an utter joke. However, as a utility library it's invaluable. Learn Angular, React, or some other modern framework, and lean on JQuery for things those frameworks don't do. Simple example: Ever try to submit a from from an AngularJS controller? Yeah, not doable. Add 2 lines of jQuery? Done! So yes, learn it, and use it where it fits.

  8. I don't get it by quietwalker · · Score: 5, Insightful

    JQuery is just encapsulating some primarily dom-related javascript mainpulation routines with the added bonus that they try to eliminate browser differences. So, when you're saying that the browser provides features that jquery was needed for, you're really saying that the browser does things that javascript is no longer needed for.

    I'm just not seeing it though. With pure HTML & CSS and a fancy new browser, can I:

    Write ajax requests and parse and conditionally apply the results to various page elements?
    Dynamically add and remove elements?
    Perform liquid resizing based on a layout approach with glue elements and fixed-but-scalable areas - that is dependent upon the size of other elements rather than explicit browser viewport height/width?
    How about perform custom input box validation?
    Maybe set the value of a text box only when a value in a linked select box is changed?
    Pop up a dialog when a button is clicked?
    Start an image upload when you drag an image over a browser region?

    In the age of ever-closer-to-desktop-application websites, I'm only seeing more and more use of javascript frameworks - of which jquery is one - and frankly I don't see how anyone could do without it. Maybe if you're making static brochure sites, I suppose, but then you weren't using javascript for that anyway.

    Maybe the original poster meant to say "is it worth learning jquery instead of another framework or library" ? Otherwise I can't see anyone who actually creates web applications for a living even asking this.

  9. Re:meh by meustrus · · Score: 5, Insightful

    Much of it involves DOM manipulation

    Yeah? Much of jQuery is about DOM manipulation. If you don't want to make a hole, don't use a drill.

    --
    I sometimes ask revealing, often ignorant-seeming questions. Maybe they're harder to answer than you think.
  10. Re:meh by halivar · · Score: 2, Insightful

    I agree in the main that DOM manipulation is the root of all JS sin, but the list you provide is not my experience as all. Like all code, well-written JS+jQuery ought to be self-documenting. Again: caveat is well-written. The learning curve is no steeper than figuring out JS's own native esotericisms. Yes, jQuery is slow as fuck. $('#something') is something like thirty times slower than document.getElementByID(), BUT when you are in the realm of milliseconds I will trade those extra keystrokes because I'm on a deadline, and the user will not notice 99 times out of a hundred. Almost every time I've had to diagnose slow jQuery, the author was doing something bad, like reselecting the same DOM elements in tight loops.

    IOW, there has to be a balance between performance and ease of development, and jQuery is my optimal point. Sometimes it's the wrong fit: when speed is the overriding factor above all others, it's not appropriate. But to extrapolate that into a never, never, never rule smacks me as throwing the baby out with the bath water. The problems with it are usually academic, not practical.

  11. 5 Minutes by wisnoskij · · Score: 5, Insightful

    It takes like 5 minutes to learn to use Jquery, it is used in 90% of all current websites, and is still one of the best if not the best library for dynamic DOM manipulation and has incredibly easy to use ajax requests. I cannot imagine creating a dynamic website without it.

    --
    Troll is not a replacement for I disagree.
  12. Re:VanillaJS Framework by Stewie241 · · Score: 4, Insightful

    Not defending jQuery, but I think the VanillaJS page over simplifies things and it's examples are not quite equal, and seem to tout themselves as far better, when in fact, there is a lot of complexity that something like jQuery hides.

    Examples:
    1. AJAX - sure, you can memorize the special incantation of r.onreadystatechange and remember that you have to check if readyState is 4 (4? wtf?) and status isn't 200. Except in the little excerpt there there is no error handling, and you basically end up with an unresponsive page with anything except the happy path.
    2. Fadeout - sure, you can do the same thing in approximately the same number of characters, but the vanilla example is far more difficult to read and interpret.
    3. Selector speed - sure, it might be a lot faster to do getElementById or getElementByTagName, but again, you sacrifice a lot of readability and without good tools it is really cumbersome to write.

    If performance is an issue, perhaps a different, Javascript compiler is the solution. But to suggest that everybody should hand code everything in native JS instead of using the more convenient syntax that a library provides is ridiculous.

  13. You forget memory usage... by edxwelch · · Score: 4, Insightful

    When you load a javascript library the browser has to allocate memory to every function in the library even if they are never used and most web sites are using dozens of javascript libraries. While this is ok on a desktop, on a tablet - which has much less memory - it means you only have enough memory to have one web page open at a time. Some web pages are so infested with javascript libraries they cause the tablet browser to crash. And they are just displaying static text and images, something that doesn't require javascript.