6 ms·
It probably wasn’t the first, but the first notable SPA I can think of is Gmail. Do you think that architecture was just decided on by some noobs right out of s
by amw-zero 6y ago
It probably wasn’t the first, but the first notable SPA I can think of is Gmail. Do you think that architecture was just decided on by some noobs right out of school? Since it was novel at the time, probably not. That leads me to believe (along with my own anecdotes and observations) that there are real benefits to SPAs. Are there trade offs? Of course. But there are benefits too.
The idea of an SPA is only strange in the web dev community. An SPA is equivalent to a native app client - they are long running, stateful processes that communicate with a backend. That architecture has worked for decades, and there are things that you can do as a result of having that stateful process that you simply can’t do with server rendering, like caching response data to share with totally unrelated view components later on in the application. You also get to use a real programming language to design your front end instead of living within a template language, which no one acknowledges as the biggest hack of all time. Template languages exist precisely because HTML is not a sufficient UI tool in all cases.
- simonw 6y agoSPAs are a good fit for webmail. They are a bad fit for many other projects.
- reaperducer 6y agoWas Gmail always an SPA? My recollection is that it was a regular web site when it launched, and went SIA when everyone else did.
- xenomachina 6y agoGmail has been a SPA since launch. There were some pre-launch versions that were not, and it has always had a plain HTML fallback mode. I believe there may have been some major changes to the way it did the client-side rendering a few years after it launched. The original version was more ad hoc, since it was pretty much the first time anyone (at Google, at least) had built a real SPA. Later they built tools and libraries, and developed a more systematic way of doing things. (I was at Google during that time period, but never worked on Gmail.)
- hobs 6y agoAnd 99% of the time all of that is pure YAGNI.
- dzhiurgis 6y agoSo why are we conflating web apps vs web sites exactly?
- TheSpiceIsLife 6y agoMost people who aren’t involved directly with web development just call everything a ‘web page’, or ‘the web’.
- amw-zero 6y agoBecause that’s what everyone else does when saying that the performance characteristics of the two should be evaluated in the same way, e.g. page load time.
- WillPostForFood 6y agothere are real benefits to SPAs. Yes, but a lot of the benefits of SPAs and the libraries needed to work on them accrue to the developers, not the users.
- dsjoerg 6y agoIt's funny to think of developers and users as two distinct constituencies with distinct interests. I had thought any good developer, by definition, would do what's best for the user. Therefore the interests of both groups are the same. But I suppose you're right that the average developer is their own damn person with their own interests which can only ever partly align with their customer's. I suppose there are actually three parties, all distinctly interested: the programmer, the employer, and the end user. The programmer wants to get paid and do "good work". The employer is actually a multipart entity: management and investors, each of which have distinct interests. The end user is not a single such person but a mass of individuals, each with a different set of interests. This is getting messy!
- TheSpiceIsLife 6y agoThe individual end user can also be multiple distinct groups, some simultaneously: Parents / caregivers / guardians and their charges, who can be further split in to children, teens etc etc.
- amw-zero 6y agoSome benefits are for developers. And some are for the users. For example, many users, particularly ones who care about the look and feel of things, prefer when there is a smooth transition between screens in response to their actions. You simply can’t do that with server rendering (barring hacks like Turbolinks, which are just approximating SPAs).
- WillPostForFood 6y agoI agree, and I'm more critical of heavy front end Javascript frameworks that are part and parcel of SPAs. Things like the Turbolinks hack you mention, IMO, provide the best user experience, especially fast initial page load. But that can be messy to develop, so we end up with Angular or React which smooth the development issues, but make pages fat and slow for users.
- missblit 6y agoGmail has a "basic view" that works without JavaScript, just good old fashioned HTML forms and hyperlinks and server-side state. Though it's more or less static feature wise, if it weren't for the updated logo you'd never be able to tell it was written within the last decade.
- chillfox 6y agoSure, SPA is the correct technology for certain applications, but not for every damned website.
- TheSpiceIsLife 6y ago> Gmail. Do you think that architecture was just decided on by some noobs right out of school? Since it was novel at the time This is Google we’re talking about. Does fit the caricature.
- deleted 6y ago[deleted]
- Legogris 6y agoWhile Outlook Web Access (2000) was earlier, Gmail (2004) and Google Maps (2005) were definitely instrumental in establishing AJAX and the SPA pattern (though the term SPA came much later I think).
- gnaritas 6y agoAbsolute nonsense, you can do all of that server side as well.
- another-dave 6y agoGmail is probably the example that I hold up as an SPA gone awry — on a new machine & T1 broadband you can still get _very_ slow loading times to open the site at all. & what it's serving you in the end doesn't feel like it's heavy lifting in this day & age — a subject line & preview of your first N emails — I think the site could be much more responsive if they had a JS enhanced page (e.g. using it for their predictive text) rather than an SPA.
- SteveMoody73 6y agoGMail has gone downhill massivly since it first started. I Can read the entire contents of a mail and go back to inbox and it still shows the email as unread. Closing the gmail tab usually comes up with a prompt saying it's busy and am i sure i want to close tha tab. I would consider it as an example of how not to write a SPA these days
- amw-zero 6y agoI made a comment elsewhere about page load time not being the only dimension of performance. Page load time’s importance gets amortized across the length of the whole session. You should always try and minimize it, but in an application like Gmail you’ll be using it for minutes at a time. Each subsequent interaction is now quicker because there doesn’t need a page refresh. Page load time is one dimension. We get really hung up on it.
- another-dave 6y agoI agree with your reasoning but not how it applies to Gmail :) I'm always hazy on the term amortized, but my understanding of it was the opposite — in that, you should try to chunk up as much as possible. If you are using Gmail for a longer period, having to wait for functionality like advanced search or predictive typing is less annoying as the extra time you need to wait is a smaller portion of your session overall. Plus, these things may have lazy loaded by the time you come to use them. On the other hand, if you just wanted to reference an email quickly — e.g. I often need to dip into email quickly, for example, if I've travelling and have booking confirmations / QR Codes / PNRs etc. in starred messages in the inbox — you'll notice any extra load time so much more. So to me, feels preferrable to have as small as possible initial load time, then extra functionality progressively loaded in the background. I do agree for something like Netflix for example that a 'big load up front' is probably preferrable. I'm 'in for the long haul' as I'm going to be watching something that's at least 30minutes up to a feature length film, so a few seconds extra load time is negligble.