aboutsummaryrefslogtreecommitdiff
path: root/content/posts/2022-10-06-state-of-web-technologies-in-year-2022.md
diff options
context:
space:
mode:
authorMitja Felicijan <mitja.felicijan@gmail.com>2024-03-10 14:59:14 +0100
committerMitja Felicijan <mitja.felicijan@gmail.com>2024-03-10 14:59:14 +0100
commit1100562e29f6476448b656dbddd4cf22505523f6 (patch)
tree442eec492199104bd49dfd74474ce89ade8fcac9 /content/posts/2022-10-06-state-of-web-technologies-in-year-2022.md
parenta40d80be378e46a6c490e1b99b0d8f4acd968503 (diff)
downloadmitjafelicijan.com-1100562e29f6476448b656dbddd4cf22505523f6.tar.gz
Move back to JBMAFP
Diffstat (limited to 'content/posts/2022-10-06-state-of-web-technologies-in-year-2022.md')
-rw-r--r--content/posts/2022-10-06-state-of-web-technologies-in-year-2022.md296
1 files changed, 296 insertions, 0 deletions
diff --git a/content/posts/2022-10-06-state-of-web-technologies-in-year-2022.md b/content/posts/2022-10-06-state-of-web-technologies-in-year-2022.md
new file mode 100644
index 0000000..fc00ea0
--- /dev/null
+++ b/content/posts/2022-10-06-state-of-web-technologies-in-year-2022.md
@@ -0,0 +1,296 @@
1---
2title: State of Web Technologies and Web development in year 2022
3url: /state-of-web-technologies-and-web-development-in-year-2022.html
4date: 2022-10-06T12:00:00+02:00
5type: post
6draft: false
7---
8
9## Initial thoughts
10
11*This post is a critique on the current state of web development. It is an
12opinionated post! I will learn more about this in the future, and probably
13slightly change my mind about some of the things I criticize.*
14
15I have started working on a hobby project about two weeks ago, and I wanted to
16use that situation as a learning one. Trying new things, new technologies, new
17tools. I always considered myself to be an adventurous person when it comes to
18technology. I never shy away from trying new languages, new operating systems
19etc. Likewise, I find the whole experience satisfying, and it tickles that part
20of my brain that finds discovery the highest of the mountains to climb.
21
22What I always wanted to make was a coding game, that you would play in a browser
23(just to eliminate building binaries for each operating system) where you would
24level up your character and go into these scriptable battles. You know, RPG
25elements.
26
27So, the natural way to go would be some sort of SPA (single page application)
28with basic routing and some state management. Nothing crazy.
29
30> **Before we move on**, I have to be transparent. Take my views on this with
31> a grain of salt. I have only scratched the surface with these technologies,
32> and my knowledge is full of gaps. This is my experience using some of these
33> products for the first time or in a limited capacity.
34
35Having this out of the way, I got myself a fresh pot of coffee and down the
36rabbit hole I went.
37
38## Giving React JS a spin
39
40I first tried [React JS](https://reactjs.org/). I kind of like it. Furthermore,
41I have worked with libraries like this in the past and also wrote a couple of
42them (nothing compared to that level), but I had the basic understanding of what
43was going on. I rolled up a project quickly and had basic things done in a
44matter of two hours, which was impressive.
45
46I prefer using [Tailwind CSS](https://tailwindcss.com/) for my styling
47pleasures, and integrating that was also a painless experience. It was actually
48nice to see that some things got better with time. In about 2 minutes I got
49Tailwind working, and I was able to use classes at my disposal. All that
50`postcss` stuff was taken care of by adding a couple of things in config files
51(all described really well in their documentation).
52
53It is not that different from Vue which I have had more encounters with in the
54past People will probably call me a lunatic for saying this. But you know, it is
55the truth. Same same, but different. I still believe that using libraries like
56this is beneficial. I am not a JavaScript purist. They all have their quirks,
57but at the end of the day, I truly believe it’s worth it.
58
59## Bundlers and Transpilers
60
61I still reject calling [Typescript](https://www.typescriptlang.org/) to
62[JavaScript](https://www.javascript.com/) conversion a "compilation process". I
63call them [transpilers](https://devopedia.org/transpiler), and I don’t care! 😈
64
65The first one that I ever used was [webpack](https://webpack.js.org/), and it
66was an absolute horrific experience. Saying this, it is an absolutely fantastic
67tool. I felt more like a config editor than actually a programmer. To be fair,
68I am a huge fan of [make](https://www.gnu.org/software/make/), and you can do as
69you wish with this information. I like my build systems simple.
70
71Also, isn’t it interesting that we need something like
72[Babel](https://babeljs.io/) to make JavaScript code work in a browser that has
73only one client side scripting available, which is by no accident also
74JavaScript. Why? I know why it’s needed, but seriously, why.
75
76I haven’t used Babel for years now. Or if I did, it was packaged together by
77some other bundler thingy. Which does not make things better, but at least I
78didn’t need to worry about it.
79
80I really don’t like complicated build systems. I really don’t like abstracting
81code and making things appear magical. The older I get, the more I appreciate
82clear and clean, expressive code. No one-liners, if possible.
83
84But I have to give props to [Vite](https://vitejs.dev/)! This was one of the
85best developer experiences I have ever had. Granted, it still has magical
86properties. And yes, it still is a bundler and abstracts things to the nth
87degree. But at least it didn’t force me to configure 700 lines of JSON. And I
88know that this makes me a hypocrite. You can’t have it all. Nonetheless, my
89reasoning here is, if using bundlers is inevitable, then at least they should
90provide an excellent developer experience.
91
92I also noticed that now the catch-all phrase is “blazingly fast” and “lightning
93fast” and “next generation” and stuff like that. I mean, yeah, tools should get
94faster with time. But saying that starting a project now takes 2 seconds instead
95of 20 seconds is something that is a break it or make it kind of a deal is
96ridiculous. I don’t mind waiting a couple of seconds every couple of days. I
97also don’t create 700 projects every day, and also who does? This argument has
98no bite. All I want is a decent reload time (~100ms is more than good enough for
99me) and that is it.
100
101You don’t need to sell me benefits if I only get them when I start a fresh
102project, and then try to convince me that this is somehow changing the fate of
103the universe. First of all, it is not. And second, if this is your only argument
104for your tool, I would advise you to maybe re-focus your efforts to something
105else. Vite says that startup times are really fast. And if that would be the
106only thing differentiating it from other tools, I would ignore it. But it has
107some really compelling features like [Hot Module
108Replacement](https://www.geeksforgeeks.org/reactjs-hot-module-replacement/) that
109really works well. It was a joy to use.
110
111So, I will be definitely using Vite in the future.
112
113## Jam Stack, Mach Stack no snack
114
115Let's get a couple of the acronyms out of the way, so we all know what we are
116talking about:
117
118- Jam Stack - JavaScript, API and Markup
119- Mach Stack - Microservices, API-first, Cloud-Native SaaS, Headless
120
121It is so hard to follow all these new trendy things happening around you, that
122it makes you have a massive **FOMO** all the time. But on the other hand, you
123also don’t want to be that old fart that doesn’t move with the times and still
124writes his trusty jQuery code while listening to Blink 182 All the small things
125on full blast. It’s a good song, don’t get me wrong, but there are other songs
126out there.
127
128I have to admit. [Vercel](https://vercel.com/) is really cool! Love the
129simplicity of the service. You could compare it to
130[Netlify](https://www.netlify.com/). I haven’t tried Netlify extensively, but
131from a couple of experimental deployments I still prefer Vercel. It is much more
132streamlined, but maybe this is bias in me. I really like Vercel’s Analytics,
133which give you a [Core Web Vitals report](https://web.dev/vitals/) in their
134admin console. Kind of cool, I’m not going to lie.
135
136This whole idea about frontend and backend merging into [SSR (server-side
137rendering)](https://www.debugbear.com/blog/server-side-rendering) looks so good
138on paper. It almost doesn’t come with any major flaws.
139
140But when it comes to the actual implementation, there is much to be desired.
141I’m going to lump [Next.js](https://nextjs.org/) and
142[Nuxt.js](https://nuxtjs.org/) together because they are essentially the same
143thing, just a different library.
144
145Now comes the reality. Mixing backend and frontend in this manner creates this
146weird mental model where you kind of rely on magical properties of these
147libraries. You relinquish control over to them for better developer experience.
148But is that really true? Initially, I was so stoked about it. However, the more
149I used them, the more I felt uncomfortable. I felt dirty, actually. Maybe this
150is because I come from old ways of doing things where you control every step of
151request, and allowing something to hijack it feels like blasphemy.
152
153More than that, some pretty significant technical issues arose from this. How do
154you do JWT token authentication? You put it in `api` folder and then do some
155fetching and storing into local state management. But doing this also requires
156some tinkering with await/async stuff on the React/Vue side of things. And then
157you need to write middleware for it. And the more I look at it, the more I see
158that this whole thing was not meant to be used like this, and it all feels and
159looks like a huge hack.
160
161The issue I have with this is that they over-promise and under-deliver. They
162want to be an all-in-one replacement for everything, and they don’t deliver on
163this promise. And how could they?! We have to be fair. It is an impossible task.
164
165They sell you [NoOps](https://www.geeksforgeeks.org/overview-of-noops/), but
166when you need to accomplish something a little bit more out of the scope of
167Hello World, you have to make hacky decisions to make it work. And having a
168deployment strategy that relies on many moving parts is never a good idea.
169Abstracting too much is usually a sign of bad architecture.
170
171Lately, this has become a huge trend that will for sure bite us in the future.
172And let’s not get it twisted. By doing this, PaaS providers like
173[AWS](https://aws.amazon.com/), [GCS](https://cloud.google.com/), etc. obscure
174their billing, and you end up paying more than you really should. And even if
175that is not an issue, it comes down to the principle of things. AWS is known for
176having multiple “currencies“ inside their projects like write operations, read
177operations, etc. which add up, and it creates this impossible to track billing
178scheme. It all behaves suspiciously like a pay-to-win game you could find on
179mobile phones that scams you out of your money.
180
181And as far as I am concerned, the most important thing was me not coding the
182functionalities for the game I want to make. I was battling libraries and cloud
183providers. How to deploy, what settings are relevant. Bad documentation or
184multiple versions of achieving the same thing. You are getting bombarded by all
185this information, and you don’t really have any control over it.
186Production-ready code becomes a joke, essentially. Especially if you tend to
187work on that project for a prolonged period of time.
188
189All of these options end up creating a fatigue. What to choose, what not to
190choose. Unnecessary worrying about if the stack will still be deemed worthy in
191six months. There is elegance in simplicity.
192
193> JavaScript UI frameworks and libraries work in cycles. Every six months or
194> so, a new one pops up, claiming that it has revolutionized UI development.
195> Thousands of developers adopt it into their new projects, blog posts are
196> written, Stack Overflow questions are asked and answered, and then a newer
197> (and even more revolutionary) framework pops up to usurp the throne.
198> — Ian Allen
199
200And this jab at these libraries and cloud providers is not done out of malice.
201It is a real concern that I have about them. In my life, I have seen
202technologies come and go, but the basics always stick around. So surrendering
203all the power you have to a library or a cloud provider is in my opinion a
204stupid move.
205
206## Tailwind CSS still rocks!
207
208You know, many people say negative things about Tailwind. And after a lot of
209deliberation, I came to the conclusion that Tailwind is good for two types of
210developers. Tailwind is good for a complete noob or a senior developer. A
211complete noob doesn’t really care about inner workings of CSS, and a senior
212developer also doesn’t care about CSS. Well, at least, not anymore. And
213developers in between usually have the biggest issues with it. Not always of
214course, but in a lot of cases.
215
216I like the creature comforts of Tailwind. Being utility first would make me
217argue that it is actually more similar to [Sass](https://sass-lang.com/) or
218[Less](https://lesscss.org/) than something like Bootstrap. Not technically, but
219ideologically. After I started using it, I never looked back. I use it every
220time I need to do something web related.
221
222Writing CSS for general things feels like going several steps back. Instead of
223focusing on what you are actually trying to achieve, you focus on notations like
224[BEM](https://en.bem.info/methodology/css/), code structuring, optimizing HTML
225size. Just doing things that make 0.1% difference. You know that saying: Early
226optimization is the root of all evil. Exactly that.
227
228I am also not saying that Tailwind is the cure for everything. Sometimes custom
229CSS is necessary. But from what I found out in using it for almost two years in
230a production environment (on a site getting quite a lot of traffic and
231constantly being changed), I can say without any reservations that Tailwind
232saved our asses countless times. We would be rewriting CSS all the time without
233it. And I don’t really think writing CSS is the best way to spend my time.
234
235I have also noticed that people who criticize Tailwind the most never actually
236used it in a real project that has a long lifetime with plenty of changes that
237will happen in the future.
238
239But you know, whatever floats your boat!
240
241## Code maintainability
242
243Somehow, people also stopped talking about maintenance. If you constantly try to
244catch the latest and greatest train, you are by that logic always trying new
245things. Which is a good thing if you want to learn about technologies and try
246them. But for the production environment, you have to have a stable stack that
247doesn’t change every 6 months.
248
249You can lock dependencies for sure. Nevertheless, the hype train moves along
250anyway. And the mindset this breeds goes against locking the code. This
251bleeding-edge rolling release cycle is not helping. That is why enterprise
252solutions usually look down on these popular stacks and only do bare minimum to
253appear hip and cool.
254
255With that said, I still think that progress is good, but should be taken with a
256grain of salt. If your project is something that should be built once and then
257rarely updated, going with the latest stack is a possible way to go. But, if you
258are working on a project that lasts for years, you should probably approach it
259with some level of caution. Web development is often times too volatile.
260
261## Web development has a marketing issue
262
263I noticed that almost every project now has this marketing spin put on it.
264Everything is blazingly fast now. I get it, they are competing for your
265attention, but what happened to just being truthful and not inflating reality.
266
267And in order to appeal to mass market, they leave things out of their marketing
268materials. These open-source projects are now behaving more and more like
269companies do. Which is a scary thought on its self.
270
271And we are also seeing a rise in a concept of building a company in the open,
272which is a good thing, don't get me wrong. But when it is using open-source to
273lure people and then lock them in their ecosystem, there is where I have issues
274with it.
275
276This might be because I have been using GNU/Linux for 20 years now and have been
277so beholden for my success to open-source that I see issues when open-source is
278being used to trick people into a false sense of security that these projects
279are built in the spirit of open-source. Because there is a difference. They are
280NOT! They have a really specific goal in mind. And the open-source is being used
281as a delivery system. Which is in my opinion disgusting!
282
283## Conclusion
284
285I will end my post with this. Web development is running now in circles. People
286are discovering [RPC](https://www.tutorialspoint.com/remote-procedure-call-rpc)
287now and this is the now the next big thing. [GraphQL](https://graphql.org/) is
288so passé. And I am so tired of it all. Of blazingly fast libraries, of all these
289new technologies that are actually just a remake of old ones. Of just the
290general spirit of the web. I will just use what I already know. Which worked 10
291years ago and will work 10 years after this. I will adopt a couple of little
292tools like Vite. But I will not waste my time on this anymore.
293
294It was a good exercise to get in touch with what’s new now. Nothing really
295changed that much. FOMO is now cured! Now I have to get my ass back to actually
296code and make the project that I wanted to make in the first place.