Live data from Hacker News

The Disadvantages of Single Page Applications (2014)

adamsilver.io

11–20 of 105 posts

Re: The Disadvantages of Single Page Applications (2014)

#11
Nearly all of these complaints about SPAs have to do with navigation. It's true, when you make a SPA, you need to factor in routing. That's part of the design decision. When you use a SPA framework like Angular, the typical go to is to use Angular UI Router (https://github.com/angular-ui/ui-router) to manage your page and state transitions within those pages. By default, you get back button support, it's highly customizable and configurable and it's not difficult to manage at all.

Re: The Disadvantages of Single Page Applications (2014)

#12
post #4

I think this article is overly negative, some of the cases are not _always_ a disadvantage. Take "fast back" as an example. If your app is interactive and updates live, the "back" page can already be up and running with the latest data, instead of first loading a cached version and then having it update with JS later. Also, personally I'm not so sure users care about things like the "stop" button working. And "fast b…

Why would users not care about the stop button working? If something in the browser is not loading, I want to hit stop so I can wait a while before trying again.

Re: The Disadvantages of Single Page Applications (2014)

#13
We need more articles like this.

SPA is a total b*tch to do user activity tracking and quirks and glitches just never end.

SPA rely on browser performance and users with slow connections or weak device - will wait much longer to see anything appearing on the page.

My advice - if you sell anything from your site - stay away from SPA.

Re: The Disadvantages of Single Page Applications (2014)

#14
In a single page application, I would expect the back button to be entirely nonfunctional, or maybe in some cases functioning as "undo" if this behavior is clearly communicated.

(I'm not sure where back-button-undo would be better than an undo button within the app, but I wouldn't rule it out. Maybe in a graphics editor where it would be convenient to use the mouse's back button.)

Re: The Disadvantages of Single Page Applications (2014)

#15
As with everything, if you're going to do SPA, you should do it well. So far, one of the best SPA website I've seen is https://gocardless.com (disclaimer: I work there).

Once loaded it's probably one of the fastest website I've browsed, and it doesn't have any of the drawbacks you mentioned:

navigating to a new page is quick: ✓

navigating back is quick: ✓

remembering scroll position: ✓

cancelling navigation: ✗ but we won't allow duplicate requests so not an issue

SEO: ✓

Navigation and data loss: ? (no idea how we handle that tbh)

Navigation and loading CSS & JS: ✓ we load everything on the first load (~ 880kB) and that's it. I don't think it will ever be worst than MPA

Analytics: ✓

Automated functional testing: ✓ our unit + e2e test suites run in about 4 minutes (CI)

Our splash pages are open-sourced if you want to have a look at our setup: https://github.com/gocardless/splash-pages

Re: The Disadvantages of Single Page Applications (2014)

#17

Other points of note: The whole history API exists to help the SPA experience (but others too). The site still needs to be able to render something like: www.foo.com/customers/10 even if www.foo.com is a SPA and via clicks can go to /customers/10. This may require more server work, so you're not exactly making life much easier for yourself. You still need to handle cases where a web crawler comes in without good java…

Not really - these days even googlebot can and does execute enough javascript to craw #/customers/10. Screen readers can do javascript and you can use ARIA to make it easy to browse for blind people.

Re: The Disadvantages of Single Page Applications (2014)

#18
SPA applications frameworks and architecture are so young compared to server side rendering and still evolving.

Why do they exist? User expectations of the web are increasing and waiting for server responses from any action isn't really cutting it anymore.

Of course it's harder to maintain state and develop - the patterns haven't been clearly defined, and SPAs introduce two sources of state (client and server) which is a hard problem. It's the cost of the demanded user experience.

Angular ui router, ember data, react flux architecture are all examples of things that have just started evolving to address these kinds of issues. All of these are very new and being constantly iterated on and updated. Angular ui router does a good job of handling things like the back button and managing the state of your page. Ember data has really powerful client side data state management, and react flux architecture presents a much needed practice of how to control the flow of data between server calls and views. HyperMedia APIs are another evolving technology for maintaining more control between the client and the server.

Re: The Disadvantages of Single Page Applications (2014)

#19
I must say i'm constantly surprised by the negativity towards changes in technology by the technology oriented crowd. More specifically, the pure negativity. So many (here included) constantly shout negativity towards these technology concepts (SPA, in this case), and thankfully also citing what they're negative specifically about.

What i'm surprised to see though, is that so few focus on improving the tech concept (SPA). I see so many complaints, but so few fixes. I don't think SPA is inherently bad, not by a long shot. It's just that, like any young idea it is far from perfect. But, that's technology! It's how advancement goes.

As technology goes, we tend to take two steps forward one step back. But it's often for the sake of _progress_. I have a Moto 360 on my wrist as i type this, but do i consider it amazing? God no, it has some nifty features sure, but it's massive and i can't even see what the time is without turning it on.

Take that in for a second - i have a watch and i have to turn my wrist and bring it up to my face to see the damn time. But do i think that it shouldn't exist? God no. When i got my first "smart" phone it was also awful. If i followed the (seeming) mantra of these negative people, i'd have been shouting for no smartphones phones and no smart watches for years before they had a really solid UX.

I understand a MPA currently offers a more reliable and overall better UX than SPAs tend to. However, can we please focus on improving this technology concept rather than screaming for them to not exist anymore? The HTML5 History API attempts to solve many of the complaints here. It also sounds like we should use data caching (in our SPAs) so that when a user hits back, they get a back-like experience. And as far as scroll position goes, that might be something the History API should provider (if it doesn't already).

Like it or not, JavaScript is here to stay. Usage of it will only increase. Rather than saying how terrible of a UX it has, please try to think in the reverse. Even if you aren't going to work on the solutions, this is the exact type of crowd that will. Cite your concerns and UX improvements - These are the sort of people you should be helping, to help you :)

/rant

Re: The Disadvantages of Single Page Applications (2014)

#20

Finally some love for the anti-SPA crowd. Subjective here, but there's something nice about Post Redirect Get and Plain Ol' Hyperlinks from a User Experience. Whenever I interact with a regular web application, I am relieved. Not every "forms over data" or ecommerce experience has to be Gmail. Even in mobile.. SPA just isn't that much nicer. Also, I think maintaining these SPAs is ridiculously more difficult. I don't…

Agree. The few SPA sites I use annoy the heck out of me. garmin connect is one that I use, and when I view an activity and want to go back, I need to wait .5 or 1 second as the page loads. Sure, I have a nice empty list to look at as it loads, which just annoys me more. I don't know if this is a fault of SPAs, or just poor app design because there seems to be no caching. The delay is just log enough to annoy me.
Post reply on HN