Comment by flomo

20 days ago

After having some time to think about it, I've seen some really perverse DOM stuff in jquery. Like $(el).next().children(3) type stuff. So I think this stuff really fell-over when there was 'too much state' for the DOM.

I think if you want to go high-dom manipulation a la jQuery, and want some form of complex state, storing the state _on_ the DOM might make sense? Things like data attributes and such, but I also feel like that’s itching for something more like htmx or maybe svelte (I’ve not looked into either enough, so I may be completely off base).

I do agree with the notion that jQuery is easy to mishandle when logic grows beyond a pretty narrow (mostly stateless) scope. It’s fantastic up until that point, and incredibly easy to footgun beyond it.

  • Yeah, that's the thing, it might make sense in some simple 1-dimensional case, but beyond that it turns into spaghetti code (or a homebrew 'framework'). The big thing is that if you want to re-gigger some of the DOM, React is actually a lot nicer than jquery.

    • I’ll die on the “give me Vue over react any day” hill in that case, admittedly because I think React’s template/code mix is atrocious. I also _feel_ like React suffers from “why not do everything” syndrome, and that’s from a very naive perspective so grain or mountain of salt

      1 reply →