3 ms·
There have been many cycles of doing "everything on the server", then "everything on the client", and back again. Right now, it's swinging back to the doing eve
by jiggawatts 3y ago
There have been many cycles of doing "everything on the server", then "everything on the client", and back again. Right now, it's swinging back to the doing everything on the server. First it was mainframes, then PCs, then Citrix, then laptops, HTML, client-side rendering, server-side rendering, etc...
Server-side rendering has a huge advantage though: it needs one less "layer". With client-side rendering you have code in the browser, code on the server, and code in the database. You need defined protocols between every layer. With three layers and two hops, that's effectively 5 things you need to develop.
With HTML-based development, the client side code basically doesn't exist any more. You don't need to send the browser JSON via an API to be decoded and converted to HTML. You just send the HTML as-is. Just write the web server and the database, connect them, and you're done. That's 3 things you need to develop.
I've watched developer after developer start trivial web pages -- not even really apps -- with stacks like Angular and get bogged down in the complexity of things like client-side authentication protocols, multi-API security, making sure JSON APIs don't leak information inadvertently, having to batch queries with GraphQL, and on, and on, and on...
None of that is necessary with HTML being generated by the server.