Live data from Hacker News

Just Use jQuery

twitter.com

31–40 of 41 posts

Re: Just Use jQuery

#31
jQuery is the "just works" of Javascript. There's no build step required, it's plug 'n play.

jQuery and PHP's ease of integration was what helped get me from HTML + CSS to interactive websites.

Long may they continue.

Re: Just Use jQuery

#32
post #19

I'm quite happy with Vue, and the Vue HTTP component loader so I don't have to deal with the build process in Python apps. I also quite enjoyed Svelte. I have very little interest in touching the DOM imperatively when a declarative option exists.

I was a big advocate for “just use jQuery” amidst the JS framework hype ~10 years ago, but nowadays I agree that plain Vue hits a similar mark quite well. Even just a naive approach of plopping a whole page in one big component or enhancing a page rendered elsewhere by mounting a few self-contained widgets on it is nicer than manually keeping track of state with events. Even my best an most concerted efforts at jQuer…

One downside of Vue is that you need a build system for it; I really like the ability to "just" serve files, or build things on-demand when needed (even with cache that's 20 lines of code or so).

It's just too slow and convoluted to do that (I tried), and this gets even worse with TypeScript because tsc is so darn slow to startup.

The closest I've gotten is running the JavaScript build system as a subprocess in the application itself, but meh...

Re: Just Use jQuery

#33

Honest question from a backend developer: Is it still necessary to use JQuery in 2023 instead of vanilla js? I always had the impression JQuery was more useful to decouple you from the pain of multi-browser development in the 2000s dark ages of browser standards adoption.

It's no more necessary than Twig is compared to raw PHP.

jQuery syntax is clean, it works, why change that?

Re: Just Use jQuery

#34
post #30
post #25

Earlier quoted context omitted.

There is no need for jQuery nowadays. That said, it in still convenient. Compare: $(“.submenus”).hide() vs let submenus = document.querySelectorAll(“.submenus”); for (let i = 0; i

Why not this? document.querySelectorAll("p").forEach(e => e.style.display = "none")

Or:

    for (const e of document.querySelectorAll("p")) { e.style.display = "none" }

Re: Just Use jQuery

#35
post #32
post #19

Earlier quoted context omitted.

I was a big advocate for “just use jQuery” amidst the JS framework hype ~10 years ago, but nowadays I agree that plain Vue hits a similar mark quite well. Even just a naive approach of plopping a whole page in one big component or enhancing a page rendered elsewhere by mounting a few self-contained widgets on it is nicer than manually keeping track of state with events. Even my best an most concerted efforts at jQuer…

One downside of Vue is that you need a build system for it; I really like the ability to "just" serve files, or build things on-demand when needed (even with cache that's 20 lines of code or so). It's just too slow and convoluted to do that (I tried), and this gets even worse with TypeScript because tsc is so darn slow to startup. The closest I've gotten is running the JavaScript build system as a subprocess in the a…

You can run it with just a script tag: https://vuejs.org/guide/extras/ways-of-using-vue.html#standa...

They even describe it as a "declarative replacement for jQuery" in the docs!

Re: Just Use jQuery

#36
post #35
post #32

Earlier quoted context omitted.

One downside of Vue is that you need a build system for it; I really like the ability to "just" serve files, or build things on-demand when needed (even with cache that's 20 lines of code or so). It's just too slow and convoluted to do that (I tried), and this gets even worse with TypeScript because tsc is so darn slow to startup. The closest I've gotten is running the JavaScript build system as a subprocess in the a…

You can run it with just a script tag: https://vuejs.org/guide/extras/ways-of-using-vue.html#standa... They even describe it as a "declarative replacement for jQuery" in the docs!

How do you include all the pages and components with that? e.g. I have about 60 .vue pages and 10 .vue components. Last time I looked at this everything seemed pretty hacky and came with some pretty serious trade-offs.

Re: Just Use jQuery

#37
post #9

I often make a similiar joke when I am struggling with microservices related bugs or architectural designs. 1: Just use apache + php 2: Use microservices, service meshes, k8s etc. 3: Just use apache + php Cheap joke though, although it was fun, applications and demands have changed. Especially in the environments I work in today. Although I often, as an excersize, question myself why stuff got so complicated and if t…

Right? I had a lot of fun learning K8s for a client. Every new thing I learnt made me think it was even cooler.

Then the first maintenance came. _"Not worth it"_ doesn't even begin to cover it.

If you have both:

a) Well designed microservices that follow the 12 Factor App principals _fully_ b) A team of (minimum) five to dedicate solely to K8s maintenance

Sure, go for it. How many people using K8s can tick both of those though?

If you want something reliable, easy, and (almost) maintenance free; Just use AWS Lambda + API Gateway (or whatever Google and Microsoft equivalents you have).

Re: Just Use jQuery

#38
post #22

I'm quite happy with Vue, and the Vue HTTP component loader so I don't have to deal with the build process in Python apps. I also quite enjoyed Svelte. I have very little interest in touching the DOM imperatively when a declarative option exists.

> Vue HTTP component loader Whats this? Can you link?

https://github.com/FranckFreiburger/vue3-sfc-loader

Re: Just Use jQuery

#39
post #25

Honest question from a backend developer: Is it still necessary to use JQuery in 2023 instead of vanilla js? I always had the impression JQuery was more useful to decouple you from the pain of multi-browser development in the 2000s dark ages of browser standards adoption.

There is no need for jQuery nowadays. That said, it in still convenient. Compare: $(“.submenus”).hide() vs let submenus = document.querySelectorAll(“.submenus”); for (let i = 0; i

why not

  const $ = s => document.querySelectorAll(s);
  const hide = e => e.style.display = 'none';
  $('.submenus').forEach(hide);
or, if you're okay with changing prototypes

  const $ = s => document.querySelectorAll(s);
  NodeList.prototype.hide = function () {this.forEach(e => e.style.display = 'none');};
  $('.submenus').hide();

Re: Just Use jQuery

#40
post #37
post #9

I often make a similiar joke when I am struggling with microservices related bugs or architectural designs. 1: Just use apache + php 2: Use microservices, service meshes, k8s etc. 3: Just use apache + php Cheap joke though, although it was fun, applications and demands have changed. Especially in the environments I work in today. Although I often, as an excersize, question myself why stuff got so complicated and if t…

Right? I had a lot of fun learning K8s for a client. Every new thing I learnt made me think it was even cooler. Then the first maintenance came. _"Not worth it"_ doesn't even begin to cover it. If you have both: a) Well designed microservices that follow the 12 Factor App principals _fully_ b) A team of (minimum) five to dedicate solely to K8s maintenance Sure, go for it. How many people using K8s can tick both of th…

Or AWS ECS instead of Kubernetes.
Post reply on HN