Live data from Hacker News

Why I hate your Single Page App

medium.freecodecamp.org

71–80 of 128 posts

Re: Why I hate your Single Page App

#71

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.

Funny that you mention it. Loosing form data on page refresh or clicking "back" button was a problem on the Web until browsers started keeping form state along with page history. Suddenly millions of websites got this new feature without actually doing anything differently. But that was only possible because page transfers were semantic. Frameworks of that time that tried to manage their own form state (like ASP.NET WebForms) didn't have real page transfers, so they didn't get this "upgrade" and currently are significantly worse off in terms of usability.

I think there is a lesson here.

Re: Why I hate your Single Page App

#72

> 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. My SPA is different - https://www.seasonalfoodguide.org . Browser back button works like normal. Each screen has its own discrete URL, so you can share links, refresh, bookmark or open in a ne…

> They can all be added, it just takes effort.

This, in combination with the fact that developers don't take the extra effort, is exactly what the article is complaining about.

Re: Why I hate your Single Page App

#74

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…

Since we're talking about poorly implemented features. Why I hate your SPA: - If I click on a link, I receive no indication that I actually clicked a link, then 2-10 seconds later the page abruptly loads. Sometimes the page doesn't load at all. - I cannot tap and hold a link, wait a second for the pop-up menu, and open the link in a new tab because the link isn't actually a link. It's implemented in JavaScript. - The…

Back and forward buttons should scroll when there is a link to an anchor on the same page.

Re: Why I hate your Single Page App

#75

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…

The last bullet is just a straight up error on the part of the developer. The third... isn't real? What browser doesn't save form state?

The first two are fair criticism but they aren't nearly as detrimental to the user experience as the typical single page app antipatterns (no history, no indication of page loading, refresh button is broken, etc).

While it is of course possible to execute any design well or poorly, the observation that a typical single page app is worse than a typical multipage app is certainly valid.

Re: Why I hate your Single Page App

#76

> 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. My SPA is different - https://www.seasonalfoodguide.org . Browser back button works like normal. Each screen has its own discrete URL, so you can share links, refresh, bookmark or open in a ne…

> My SPA is different

Only one data point, but 15 seconds to load here. After that, yes, everything is, as advertised, snappy.

Re: Why I hate your Single Page App

#77

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…

Since we're talking about poorly implemented features. Why I hate your SPA: - If I click on a link, I receive no indication that I actually clicked a link, then 2-10 seconds later the page abruptly loads. Sometimes the page doesn't load at all. - I cannot tap and hold a link, wait a second for the pop-up menu, and open the link in a new tab because the link isn't actually a link. It's implemented in JavaScript. - The…

When you click a link or button on a normal website, the browser doesn't give indication on the ongoing state of your http request either. Only a javascript-enhanced experience can do that.

Clicking on a save button and seeing the page hang is the normal way browsers handle http requests. But a javascript-enhanced experience can tell users about the local perception of the http request (ongoing, timeout, retry, error), or it can inform the user that it's safe to navigate away while their requests retry.

Re: Why I hate your Single Page App

#78

Earlier quoted context omitted.

Since we're talking about poorly implemented features. Why I hate your SPA: - If I click on a link, I receive no indication that I actually clicked a link, then 2-10 seconds later the page abruptly loads. Sometimes the page doesn't load at all. - I cannot tap and hold a link, wait a second for the pop-up menu, and open the link in a new tab because the link isn't actually a link. It's implemented in JavaScript. - The…

When you click a link or button on a normal website, the browser doesn't give indication on the ongoing state of your http request either. Only a javascript-enhanced experience can do that. Clicking on a save button and seeing the page hang is the normal way browsers handle http requests. But a javascript-enhanced experience can tell users about the local perception of the http request (ongoing, timeout, retry, error…

Most browsers at least show a spinner somewhere, do they not?

Re: Why I hate your Single Page App

#79
post #32

Earlier quoted context omitted.

> When I have multiple tabs open, your badges and notifications fall out of date, because you never poll for updates. How bad is that really if users are aware of it and they can simply reload the page?

Not very bad for Hackernews. Terrible for Facebook, Twitter or any website that claims to be interactive

Personally, I'm not eagerly waiting for updates on Facebook all the time. They might as well appear after a reload.

Of course, chat/messenger is something else, but I consider that an exception. (It's easy to build a chat service on top of a static website).

Re: Why I hate your Single Page App

#80
post #56

Earlier quoted context omitted.

You're basing a lot of this viewpoint on fast internet connections. Javascript code rendering will be faster if you have a slow internet connection and are using an updated browser with a fast javascript engine

In theory you have a point. In practice though the initial loading of the first page is so slow that it completely negates the benefits entirely. It also doesn't work well when opening lots of tabs (which is a popular technique that helps immensely when browsing on a slow connection as pages are loaded in the background). And if you have a really slow or spotty connection the javascript page would barely load at all.

I think you're basing this off of old technology. With webpack 2 and HTTP/2, this is less of an issue. But, the top comment's statement I think is the most valid: if you're loading static text, then simple html pages are the best. Notice the rise in popularity of static site generators for this purpose. A SPA will win out when you have lots of interactions and you only experience the initial loading of the first page once - and then the majority of your user experience is around interacting with the app.
Post reply on HN