← Back to the journal

My thoughts on server side rendering

Posted on Dec 30, 2020Mohamed Said

When I first started building web apps, a web developer was a full-stack developer in today's terms. I was responsible for everything from hosting, writing business logic, converting PSD to HTML/CSS, rendering views on the server, building links, and submitting web forms.

Then with the evolution of things like Backbone.js and Handlebars.js, separation of developer roles became possible. I was always interested in the part that deals with business logic, databases, and servers so I was relieved that my job stops at the part where the server accepts JSON and responds with JSON. Now I don't have to worry about the client side with its colors and sizes and borders and paddings and margins etc...

It wasn't long before I was asked to get involved in the frontend part again, because I was the only developer in a company that couldn't afford hiring a frontend-dedicated developer. I hated it, but then discovered React.js and later Vue.js. With these tools, I was still able to focus on JSON in & JSON out and push the frontend work till the very end. Working with Vue—my favorite—is delightful and it made frontend work fun. I also convinced the company to stop making custom designs and use Bootstrap to eliminate the PSD-to-HTML part.

Now that server-side-rendering is trying to come back, I wonder how this will affect the separation of frontend and backend concerns. Frontend developers will need to learn server-side templating libraries and backend developers will need to figure which templates to return as a response. Or maybe this will bring us back to everyone having to be a full-stack developer.

Personally, I think this old server-side-rendering of template partials approach works well for teams of full-stack developers. Or is going to require complex management work to put the backend and frontend pieces together—like the old days.—Not a fan, but I see how this can be useful for teams where everyone doesn't mind working with servers and CSS/HTML but hates working with JavaScript. Or solo developers building full applications.

The different approaches just move the complexity to different places. Respond with JSON and the complexity moves to the client, render on the server and the complexity moves to the server. If the team has strong JS frameworks knowledge, then handling complexity in the client is going to be a breeze. If the team doesn't have that then handling the complexity in the server makes more sense. No approach is better than the other, or simpler.

Does it matter which approach you take on the final product? I highly doubt. I believe you can build a successful app using anything. So it's just a matter of what your favorite tools are and what your team is capable of.