Hacker News new | ask | show | jobs
by pippy 2044 days ago
The culture change around the importance of performance is frustrating, new developers all seem to love their massive JavaScript libraries. Giving a trivial function such as search box on a webpage or some animation results in a convoluted 10MB JavaScript monster from hell. If they run into anything remotely challenging they'll simply add a library to do it for them creating more bloat. It used to be the opposite. When asked 'why not just some jQuery and DOM'? they'll reply it's too hard. React, webpack, node etc are great tools but they need to used carefully.
3 comments

React/vue/etc are not massive libraries. The problem usually comes from websites loading 5 versions of jquery and then 30 ad network scripts.

And yes, doing anything mildly responsive with jquery is too hard. And not in the "I don't know how to do this" way. Its just a huge waste of time. What takes 100 lines of jquery code can be done for free with jsx. Usually jquery sites settle for sub optimal UX because its too hard to do the things react sites do.

Yes, what I was alluding too was that new tooling tends to make it easier for client resources to explode out of control.

Don't get me wrong, jsx is great. but it should be used in the right place.

For most apps that I've use, jQuery and DOM would be able to do it, just no where near as well as react or vue. We're building web apps that are highly responsive with lots of UI effects. Even when it seems like there isn't much FE code going on, you'll normally find that majority of it is now done with preloading and XHR calls to give a smoother feeling. As long as a site fully loads within 2 seconds then I'm ok with that.
> Giving a trivial function such as search box on a webpage or some animation results

If you want great UI and UX, these are anything but trivial. This is why taking an off the shelf solution is preferable to reinventing the wheel in the pursuit of marginal improvements of speed (not mentioning 3rd party solutions are often still faster than what you could whip up in a day or 2).