Live data from Hacker News

Why I hate your Single Page App

medium.freecodecamp.org

11–20 of 128 posts

Re: Why I hate your Single Page App

#11
Why I hate your classic HTML app:

- Every click is a full page load, and you still didn't manage to get caching right, so it takes 2 seconds to load.

- When I have multiple tabs open, your badges and notifications fall out of date, because you never poll for updates.

- If I mis-enter information into a form, your error handling forgets all my information and I have to re-enter it.

- You forgot to update the styles on that rarely-used page, and now it's got half the new CSS and half the old CSS and the point is the header runs halfway down the goddamn content in Times New Roman.

I get it, there are problems with SPAs. But this perfect land of one-page-per-link has real usability problems if it's not implemented properly, and there's a lot of maintenance overhead associated with a sprawling mass of transcluded templates. If we're going to criticize an architecture because it's easy to poorly implement, I don't think "ROCA" or whatever we're calling it has any meaningful benefits over SPAs in the general case.

Re: Why I hate your Single Page App

#13
Some of this hits home for me. I work on the WAY DEEP backend of one of these 'modern single page apps', so dont really care about the REST apis or UI/UX. I will say our actual website is a nightmare to use and I attribute a lot of it to (A) mgmt demanding bad UI/UX on short timeframes(B) front end folks having the power to write butt loads of JS code to achieve said goals with no thought to system wide architecture / integration. We have so much shit happening each time you click to a different part of webapp, we seem to have hit the messy phase of a codebase where you cant change one part of the site without breaking something else in a totally different section of the codebase.

to be fair though, as with everything there are pros and cons. Once i learned to deal with some of complexities and crazy UI/UX, using our web app is like driving a spaceship and it does work pretty fast considering all the data getting lifted, html getting rendered etc.

Re: Why I hate your Single Page App

#14
post #5

None of the things described here are inherent to single page apps. Ember (with Ember Data and proper routing), for example, solves most of the issues he brings up (back button not working, failure to link to individual items) by convention.

The downside of Ember (at least the last time I used it, several years ago) is you must do things "the Ember way", which isn't inherently bad, but there's a lot of implicit functionality that "just works" until it doesn't, and can make debugging a painful experience.

Re: Why I hate your Single Page App

#15
but that's the point: an application isn't a webpage. An app doesn't have a concept of back and forward, it has undo & redo. It doesn't need refreshing because it's syncing with the server by websocket. It doesn't have location it has state.

Re: Why I hate your Single Page App

#16
One big downside of SPAs the author didn't mention is the chain reaction effect I wrote about last year[1], where if you start to implement one browser-native feature in JS, it breaks other browser-native features, and it begins a chain reaction where you basically implement the whole site in JavaScript, and the result ends up being noticeably worse than if you had just stuck with native browser features from the beginning. It's not necessarily specific to SPAs, but it's definitely a very common problem I see with them.

[1]: https://sdegutis.com/blog/2016-03-21-why-i-dont-use-clojures...

Re: Why I hate your Single Page App

#17
> Maybe your single page app is different, but the ones that I know break most of my browser’s features, such as the back and forward buttons, page refresh, bookmarking, sending a link, or opening a link in a new window or tab.

That reminds me: if anyone out there has any advice how to make AppCache play nice with JavaScript-based routing solutions (say, react-router), please let me know.

Re: Why I hate your Single Page App

#20

Why I hate your classic HTML app: - Every click is a full page load, and you still didn't manage to get caching right, so it takes 2 seconds to load. - When I have multiple tabs open, your badges and notifications fall out of date, because you never poll for updates. - If I mis-enter information into a form, your error handling forgets all my information and I have to re-enter it. - You forgot to update the styles on…

"If I mis-enter information into a form, your error handling forgets all my information and I have to re-enter it."

This. I have a very short list of architectural must-haves that I use when evaluating junior dev's code at the start of a project, and not having robust error handling that preserves submitted form information is right up near the top.

It's an annoying design mistake with two input elements, unworkable with five, and just plain cruel beyond that.

Post reply on HN