I still vividly remember the days when BackboneJS came out, it might not the first Single Page Application framework, but probably the most notable one at that time. Before that, I was doing lots of Rails development for building web apps. BackboneJS for sure gave me a feel of fresh air when developing web UIs. Everything related to UI just became so lightweight to develop. Yes we would need to start thinking extra things which were covered by the browser in the past, things like manually handle form submission, URL redirects using JavaScript which is built-in into the browser already.
But there is the upside, like everything else. It’s the tendency to create more customer experience focused product, it nudges you to think more about the experience, instead of your beautiful data. I am not saying SPA will inherently have a better UX than MPA, that’s also what so many people are criticizing SPA for, saying they ruined the web, which I can’t disagree more. Just look at the advancement we made over HTML5, JavaScript and CSS, it’s hard to imagine if we are still rendering each web page statically on the server side using JSP, are we gonna get any of these? It’s exactly because we are keep pushing the boundaries using rich client side computing, creating madness things on the web pushes these web standards forward. Somewhat like the game industry did to the computer hardwares.
But maybe we are doing way too much on the client side using JavaScript? There is a trend in the recent years that to move most of the things if not everything back to server. At first I was one of them cheering for this as well, because of the insane complexity of the front end space. Until one day I was trying to do a tab switch using web socket to change the state on the server side. Wait a second, there is something wrong here. As a user, I am suddenly scared of knowing that everything I do on my screen were processed and scrutinized on the server.
Not because it’s posting the privacy issue by piggy back to servers every single click (it does so too), the problem I am concerned is we setup ourself again to be further away with the users. I’ve been doing a lots of front end only development and mixing both, at last I found that it’s extremely hard to build something really great by thinking everything in the backend context. Dealing with data vs dealing with human interaction is fundamentally different. I admire people can do both well at the same time.
SPAs aren’t a mistake. It’s something in the history for the first time reminds us: your code doesn’t matter if it can’t express nicely in a human friendly form.
We as human like to go to extremes, because it’s so much easier to do so. It’s hard to calibrate, to pick, to combine, to make the best of both worlds. Though I think we are gradually reaching there. Oh, also don’t forget, doing everything on the browser sometimes can be quite beautiful.