4 ms·
It’s really amazing watching trends in web UX reverse in realtime. Can’t wait to log in and find one day that flexbox/grid are bad and we’ve reinvented table an
by moribvndvs 3y ago
It’s really amazing watching trends in web UX reverse in realtime. Can’t wait to log in and find one day that flexbox/grid are bad and we’ve reinvented table and frame layouts.
There are loads of web apps that have rich interactivity where mixing presentation with supporting logic creates a real mess. Say you’ve got a grid with a million (gasp!) rows. You’re really gonna emit all that unnecessary inline JS behavior over the wire?! Why on Earth?? What if you need context binding? You could just have a jQuery .on handler registered once at the parent and filtered to all buttons, which pulls the id of the record from a data-attribute on the target element, finishing the same work in a couple of lines of code in one easy to maintain spot. Yes, adding addEventListener code all over your app would be repetitive and wasteful, but that (amongst browser incompatibilities) is why jQuery was invented, but you can hand roll your own utility or use HTMX or a million concise tools to do this. Including a right-sized dependency isn’t going to kill you. Sure, if you’ve got a stupidly simple HTML page with a couple elements with a handler or two, fine, go ahead, knock yourself out. I disagree with this one-size-fits-all assertion. We did a lot of this before and it sucked.
- danielrhodes 3y agoThe way Tailwind is setup, we may as well bring back the <font> tag.
- firecall 3y agoJust to add, what irks me is that recent culture of arrogance that enables less experienced devs to assume that all the old ways are terrible and that this new way of doing things is the only way there will ever be. What ever happened to modesty in juniors or apprentices? Maybe too many of us just age out and leave the industry :-/
- throwaway18636 3y ago[dead]
- alexpetros 3y ago> Yes, adding addEventListener code all over your app would be repetitive and wasteful, but that (amongst browser incompatibilities) is why jQuery was invented, but you can hand roll your own utility or use HTMX or a million concise tools to do this. Including a right-sized dependency isn’t going to kill you. This article is explicitly a defense of the interface that htmx (which I am a core maintainer for) employs. I think more JS libraries should use attributes as their interface. As for when and where that's appropriate, well, like anything, it depends on the context, but I'm confident in saying it's appropriate in more contexts than it is currently being used.