Hacker News new | ask | show | jobs
by shams93 3088 days ago
Yeah with jquery we were composing templates server side. Compared to Vue trying to do a SPA in jQuery is a season in hell. It can be done but it's brutal and fragile.
3 comments

> It can be done but it's brutal and fragile.

Actually many who did jQuery were proud of it.

Some of us made rock solid sites or improved exiting ones quite a bit using a technology known as progressive enhancement.

Let me tell you what is fragile: the cool things I make today that won't even try to work if I disable Javascript. :-)

Edit: and given what we have seen over the last few days now would be a good time to reconsider if every website really needs to be able to run Javascript.

I miss progressive enhancement, when/why did it die.
Did progressive enhancement ever catch on? It made for some great Rails 2 tutorials but I don't remember seeing it much in the wild.

It's going away because you basically have to write everything twice and it's hell to keep consistent.

If you need your website to work without JS, Nuxtjs is an amazing VueJS framework for SSR or static prerendering.
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.

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.

For the majority of my web development that verb is in the present tense.