5 ms·
The most common reasons for building a SPA: * That is the design pattern dictated by your large framework. * Maintaining state is absurdly simple, but it requ
by austincheney 6y ago
The most common reasons for building a SPA:
* That is the design pattern dictated by your large framework.
* Maintaining state is absurdly simple, but it requires original code if not using a big framework.
* The browser provides a simple standard API for interacting with HTML, but your framework provides abstractions you didn’t know you could live without.
That’s it. Developers twist themselves in knots trying to qualify their opinions as anything more valid than what sounds like incompetence, but with any level of informed discussion it’s clearly about competence (or insecurity).
- osrec 6y agoAnother big reason is that developers want to deliver a specific user experience that is simply not possible with the default page loading functionality of most browsers.
- masa331 6y agoYou mean the specific experience when back buttons aren't working? Or when urls don't make sense? Or when you can't just share the content by copying the url because it no longer identifies the conten? Or when you can't say if something is loading, missing, or broken? This is my user experience with SPAs regarding navigation.
- robertoandred 6y agoUse better SPAs.
- osrec 6y agoAgree. There are a lot of bad SPAs out there, but that's a testament to how easy they are to get started with and their popularity. That doesn't mean good SPAs don't exist - many do!
- ehutch79 6y agoIf an spa is behaving like that, the coders have failed at their job.
- freehunter 6y ago"PHP is fine, it's just poor developers making bad sites". And then people stopped using PHP.
- arcturus17 6y agoPeople stopped using PHP in which planet?
- freehunter 6y agoExactly.
- osrec 6y ago> And then people stopped using PHP. Evidence? In my experience, PHP seems to be more in use now than ever.
- freehunter 6y agoA quick HN search shows PHP’s unpopularity. Check the Stack Overflow survey if you need a second opinion. Conversely, I’m gonna need evidence that PHP is more popular than ever because that absolutely is an extraordinary claim.
- ehutch79 6y agoPHP wasn't good, fine maybe, though I understand it's better now. it was kind of slow, and all the functions were inconsistent, and had a lot of foot-guns. It was easier to write more robust code and model-view-controller code in other languages. (not that it was impossible in php)
- freehunter 6y ago
- chipotle_coyote 6y agoThat’s arguably the best reason to develop an SPA. But I don’t think the linked article is arguing against that as much as arguing against using “SPA think” in places where the user experience really doesn’t require it. There are web sites which are basically magazines/blogs whose reading functionality relies on JavaScript. Building a web site like it’s an app may give some advantages to the developers, but it’s almost always a slower, and sometimes more fragile, experience compared to just delivering HTML.
- nepeckman 6y agoI'll offer up another reason, which I feel is a little more accurate: * Your web app requires heavily interactive bits, such as smart forms, smart tables, previews, content editing, etc. To deliver such functionality in a maintainable way, you use a framework. (As a side note, yes it is possible to deliver this functionality in vanilla JS, but to make it maintainable one must essentially build an ad hoc framework.) Because most frameworks push users towards a SPA, you end up following the path of least resistance and developing a SPA.
- austincheney 6y agoI would argue most websites never require any of those. When any of those are required they don’t need a giant framework to achieve maintainability. All that’s needed to achieve maintainability is a competent developer who values both simplicity and written documentation.
- nepeckman 6y agoThis sentiment frustrates me. The majority of web developers today are application developers. I've spent the past 5 years delivering business applications via the web as a platform. The web has a lot of advantage as a platform: no install, cross platform, networked by default. But the web was not designed as an application platform, so making it into one is complex. Business applications have inherent complexity as well, and managing all that complexity is a non trivial task. Posts like this frustrate me because you seem to be suggesting complexity in the web domain is largely incidental.
- hootbootscoot 6y agoI would qualify this: The web is simple when one uses it as intended. (hyperlinked documents that may or may not have interactivity beyond the hyperlinking and embedded media or animations etc.) The web is complex when one attempts to do "GUI by RPC". If one is OK with page reloads, this asynch remote folder browser hypercard thingy is fine. If one seeks to replicate the event-loop desktop "window"-based application one will have the use-case for large frameworks as one will literally be re-inventing all the wheels, which they tend to do, as this is not the default behavior of the application we call a web browser.
- Scarbutt 6y agoWhat's a big framework to you? is React one?