This article at the beginning was an attempt to convince myself that single page applications are the one to blame for the internet and development being not as fun as they were before. Because browser refresh does not justify the shitshow many of web app we use on a daily basis are.
Is latency so bad that a page refresh should be avoided at all costs? Because building single page application has a cost. At least for me, I realized! I didn’t use my time to catch up with what JavaScript land space is today and with that I mean a plethora of framework all different but that look the same.
Building single page application requires building API as well. And when reading such article I realized that single page application was not the problem! They are fine, smooth and elegant when they are done with passion and care. But it is the same for server side web application, and it does not require an API first approach.
For a good part of my career I worked with AWS and cloud providers. I learned how effective and powerful I can be gluing API together and so “API first” for me was the right way to go. If they are this powerful why should I not do that? Good point but most likely it is not what you need, and you can add them on top when you need them.
This is the answer I should have got for myself! If you need a JSON API or whatever, if you need to build a web app, and you have a skill issue with SPA that you don’t want to repair do not do API or SPA because at least for me, it will be kind of annoying at the end, and it will destroy your soul!
Brain: But what if my product will need an API?
Response: You will add it later! You can make the most appropriate API and then migrate your app to use it, or you can take the shortcut of a JSON API being the same but with application/json
as Accept
header instead of text/html
.
I came to this solution because being driven by predefined solutions broke my interest in this field.
If at this point you feel personally attacked or in disagreement with me, I think you are right! Because this is my story. You may have a different skill set or background where API first, with SPA are the correct answer you should go with it. I thought it was the case for myself as well. Don’t hold on your previous decisions. Start from your experience but take the time to evaluate what’s best for your current situation today.
Do not optimize looking at the TheNewStack articles or architectural blog posts coming from companies and products that are way different compared to where you are today. It will slow down motivation, efficiency and success. Or at least I think they are breaking my enthusiasm at least.
Keep reading them if you like because it is good to know what there is available out there and how other people in different context develop efficient and successful product but at least for me figuring out my own way is a lot more interesting. Interest and curiosity drive are my signals.
The majority of the content we read about “the best way to do engineering” comes from the same kind of companies, usually Silicon Valley kind of companies backend by VC that are trying to look as better as they can, capable of influencing everyone about their way being the best option. Very often it is no the case and that’s why Software development is so cool!
Are you having trouble figuring out your way to building automation, release and troubleshoot your software? Let's get actionables lessons learned straight to you via email.