Comment by coding123

4 years ago

SPAs were not a mistake, SPAs were an attempt to make the front end work like front ends have ALWAYS worked.

Back before the web people made C++ and VB user interfaces that interact directly with the data source. SPAs are an attempt to make the web closer to that well known paradigm. POST REDIRECT REFRESH cycle was an insane programming paradigm that wasn't found in any previous edition of programming.

Not so. IBM mainframe systems (3270 terminal based) that ran most of commerce for a long time are basically the same paradigm as a web browser. Send a form to the smart terminal (GET), wait for the response with the field values (POST), send another form.

In fact there are adapters that literally turn these applications into websites by translating the forms into HTML. Commonly seen when you need to do something like change the beneficiaries on your health insurance.

“Client-server” paradigm came out in the 90s when PCs became powerful enough to run a “thick client” application, and was considered revolutionary.

In other words, the eternal cycle continues… :)

  • GUI application patterns predate the 90s (Mac, X11, Apollo Domain, Xerox Star, etc)

    • Of course yes, GUIs go all the way back to Sketchpad in 1963. The PARC work was more about putting files on a server than putting the application logic on a server. X11 put all of the application on a server (or as X11 calls it, a client…). Based on my bookshelf, the “client-server” paradigm of putting the UI part and a substantial portion of the related logic on the client, but with most of the business logic on the server, reached mainstream adoption in the 90s.

>Back before the web people made C++ and VB user interfaces that interact directly with the data source. SPAs are an attempt to make the web closer to that well known paradigm.

I wish more web developers were aware of just how damn good UI tooling was for native systems. Stuff like WinForms/WPF/Visual Studio and Cocoa/UIkit/Xcode on OSX. Perhaps we could get away from the insanity of rebuilding a select component for every new project.

> POST REDIRECT REFRESH cycle was an insane programming paradigm that wasn't found in any previous edition of programming

Actually I'm old enough to remember old mainframe CICS programming that was a lot closer to the form-based HTML server-side programming of old. When "the web" came out in the mid-90's, it was actually a "blast from the past".

Most SPAs don't interact directly with the datasource, but interact with a middle service. Also many older architecture do draw entire "pages" on the screen at once, rather than manipulating only individual components. (at least not on every interaction)

  • Clearly, we can't have an SPA front end performing an SQL query directly. The HTTP/GQL/REST services are the SPA equivalent of that data source (they are still a data source). The C++ and VB apps written back in the day were single user programs so yes that's a difference but not by much architecturally.

    "Pages" are similarly in SPAs too. We usually have a router that helps the app decide what main "page" is on the screen.