• I Cast Fist
    link
    fedilink
    arrow-up
    31
    ·
    4 months ago

    Jquery sucks now, compared to pure javascript? Now I feel old.

    • GFGJewbacca@lemm.ee
      link
      fedilink
      arrow-up
      16
      ·
      4 months ago

      Yeah, I don’t get it either. I made a store for my website a couple of years ago, and jQuery was crucial for me to handle all the events and triggers. Trying to do it in pure JavaScript looked like a complete nightmare.

      • kautau@lemmy.world
        link
        fedilink
        arrow-up
        37
        arrow-down
        1
        ·
        4 months ago

        Many of the things that jQuery made easy back in the day are now pretty easy with pure js (Ajax calls, improved selectors, programmatic DOM manipulation, etc), and browser support for most JS features is way more standardized.

        Granted, your pure JS is likely to be way more verbose to write, making it look more intimidating than jQuery.

        That being said. jQuery is performant in modern browsers, and when being delivered compressed and minified is tiny, so if you want to use it, go for it. Anybody who criticizes you or tells you “you should use [x]” for your online store or website is a JS elitist.

        jQuery is really only a “bad” choice for big interactive web apps, where frameworks that handle state and routing independently of the DOM are a much better choice.

        • aesthelete@lemmy.world
          link
          fedilink
          arrow-up
          2
          ·
          edit-2
          3 months ago

          jQuery is performant in modern browsers, and when being delivered compressed and minified is tiny, so if you want to use it, go for it. Anybody who criticizes you or tells you “you should use [x]” for your online store or website is a JS elitist.

          I was huge into jQuery but the “modern” frameworks seem like a complete dumpster fire full of poo to me.

          All of this MVCC non-sense, and components and services and bundlers and shit, megabytes of libraries and tons of time spent in the build process, security vulnerabilities in libraries like “hash-dash-framework.js” in the dependency chain, a final output that requires gigabit speed to load in a reasonable timeframe, and still I see the pages developed with Angular making 4 or 5 calls for the same fucking bit of information from the backend.

          • kautau@lemmy.world
            link
            fedilink
            arrow-up
            3
            ·
            3 months ago

            In many ways you’re correct, the “modern” js toolkit can be a nightmare. I work for a SaaS company that makes emergency management software. I’m pretty proud of our setup. It’s Vue 3, it’s incredibly optimized. We have tree shaking and code splitting, e.g. there’s hundreds of potential JS files you might load using our software, but they will only load when you need them, over a brotli compressed HTTP/2 connection so it really is efficient.

            With the amount of data we process through our API and how it’s presented to the client it would be a nightmare to not have Vue for state management and routing, axios for API calls, etc. But many SaaS products certainly aren’t optimized like ours

      • Ahardyfellow@lemmynsfw.com
        link
        fedilink
        arrow-up
        9
        ·
        4 months ago

        I just created a new tool for my company, and I opted to leave out jQuery as I wanted to see how it would be without it.

        After going through the process I don’t think I’ll use jQuery again unless it is already a dependancy. Vanilla pretty much has everything covered that jQuery made easier, just need to be a bit more verbose in some cases, but I’ve found that typically makes the code easier to read and modify.

        No hate if jQuery is your thing though, just if you’re on the fence I’d give vanilla a go and see if it fits your needs!

    • _____@lemm.ee
      link
      fedilink
      English
      arrow-up
      11
      ·
      4 months ago

      jQuery is very slept on imo. I think new Gen react heads don’t understand just how much you can do. Iirc the minimized size is also very small.