Has it ever happened to you that you tried to open a site and the browser freezes.
You then tried to restart the browser, it tried to reopen the last active page and crashes again?
It's probably not your fault but (some of) us, the lazy, time and coin saving web developers.
To dig into where the problem lies, let's take a quick dip into the evolution of web.
I will try my best not to bore you (I'm not a big fan of history myself).
- Initial computers used to be Mainframe. i.e. a big centralized powerhouse of resources with multiple "dumb", non graphical client terminals connected to it. It hosted both processing power and data storage. There was no concept of network. So web was still not born yet.
- Then came File Sharing computing. "dumb" terminals became "smart" clients with the invention of LAN. The centralized computers only hosted data which the clients used to download, process and upload back to the centralized computer. Similar to what we currently do with cloud hosted documents. With this development, all the processing shifted from the centralized computer to the client machines. So the clients became bulky. It should be noted that by "client", I'm not referring to the general public as Internet was yet to come.
- The file server architecture caused a lot of resource wastage as clients cannot share unused resources with other computers. Also the network got congested because of all the downloading and uploading going on. So we stepped back and shifted the processing back to the centralized computer (server). However, the clients remained intelligent enough to render the data sent from server in a more understandable format. It required minimal processing on the client side, so the resource wastage reduced. Also, to update some data, clients don't have to download the whole file. So the network congestion was also solved. This is the Client Server Architecture, the backbone of today's internet.
- In the late 1990's, with the evolution of internet, the client-server architecture evolved into Web Oriented Architecture. The servers processed data received from requests obeying a standard protocol HTTP and sent back response data in the same format. This standardization of request handling protocol allowed the mass public to render the response data in their client machines via an application program called "browser".
- So, we entered the era when clients receive rendered data, interacts with the user, performs API requests on behalf of the user and re-renders the data. It's the era of AJAX. The majority of processing and rendering was still handled by the servers.
So that was some history on the evolution of web. Let's enter the era where we are now.
So here is the question. Are we on the right track?
From the history we learned that the whole point of client server architecture was to keep the clients as thin as possible and let the servers take the load. We are developing web apps on a machine with high speed processors, plenty of RAM, and connected to high speed internet (all relatively) and often forget about the real users of our web app. The majority of population is still on the low-end side of processing power and memory with low internet speed. Recall how Facebook make it's employees use 2G every tuesday to feel the pain of it's consumers on slower network? Sadly, most of us, web developers are too lazy to do it.
Instead of focusing on "user friendly"-ness, we have started focusing more and more on "developer friendly"-ness. Who cares about the users, We will just post a banner like:
Oops! Looks like your mobile sucks. Please get a device with 8 core CPU and 16GB RAM to load this page.
The users will take it as their fault.