Hacker News new | ask | show | jobs
by pascalxus 3088 days ago
I'm quite surprised at this conclusion. I've always felt that doing SPA with jQuery was the easiest thing I've ever done in my development career. It's so easy to get something set up and running. And it's a breeze to figure out and read the code too: even when it's 10s of thousands of lines of code.

Is it just me, or are many of the newer frameworks actually harder to use? I tried Angular 1 about 4 or 5 years ago and it seemed like a complete disaster. Recently, I've been working on Vue and this seems a bit better.

3 comments

Depends on the SPA. If you're trying to do something relatively simple, where the events and state clearly map to the UI, jQuery isn't too bad. It's even fun.

Once your SPA goes through an iteration or two with a few different programmers, you find your events have nasty ordering dependencies and your data becomes inconsistent all on its own. You have no idea why because you can't reproduce any of these issues on your own. You have to watch other people interact with your app just to reproduce bugs ("why the hell would you double click a link?") and git bisect becomes the most productive tool in your toolbox. Most project discussions end with a shrug. You yearn for the days when it was possible for a single human to ever understand the entire app, but that was six months ago and management steadfastly refuses to fund a rewrite. You look wildly around for any sign of hope...

As for Angular, agreed, but I'd rather work with it than a bunch of jQuery. React and Vue are quite pleasant.

>And it's a breeze to figure out and read the code too: even when it's 10s of thousands of lines of code.

Not at all. The issue with an application written in jQuery is a lack of sane state management. Forgetting to initialize (or re-initialize) values, not expecting things to be executed in a different order, and just poor organization in general led to mountains of runtime errors.

Nowadays we use Elm. The difference is night and day. I wrote a post on this topic a few months ago: https://charukiewi.cz/posts/elm/

> And [jQuery is] a breeze to figure out and read the code too: even when it's 10s of thousands of lines of code.

> Is it just me

Probably.