HomeProjectsWorkBlogTimeline

Switching to React

6/19/2022
js
frameworks
react
svelte

As a web developer, you come across many ways to achieve the same goal: frameworks, technologies, languages, etc. There isn't just one way to make your dream web app; you can do whatever seems natural to you. You can use React, or you can use Angular, TypeScript, or vanilla JavaScript, bundle using Webpack, or Vite. There are so many ways to do the same thing, which seems nice because we can choose the tech stack that we like, but it comes with a cost.

As someone who has tinkered with many technologies, I didn't like the web development ecosystem because nothing is explicit. There are tens of frameworks to choose from, and even then, there are different ways of doing things (why does React still use class-based components in their docs?). When I used to make websites around 2015, I just used HTML, CSS, and JS; life was simple. But when I came back after a few years, everything had changed so drastically; there were so many different ways to do the same thing that deciding on the stack became more stressful than trying to make the app itself. In competitive programming, I started using Python, but just because I could, it didn't mean I should; I quickly realized the cons of using Python in CP and switched to C++. There was a way of doing things in this space; I didn't mind switching. There may be different paths to achieve the same thing, but they should be relatively straightforward.

I started with Svelte, the perfect framework for me: easy to use and straightforward, and I rarely had to use npm install. But because Svelte was not popular among jobs and internships, I had to switch to React. It was tough, but the vast ecosystem was new and felt nice. I didn't have to implement complex components from scratch; they were just one npm install away. I found that the tutorial series on their websites used class-based components to teach; fortunately, I had heard Fireship.io say that "class-based components are literally - the devil.", so I quickly switched to a different tutorial and found Next.js' website. Their tutorial used function-based components; they were way better than class-based. To my surprise, it was better than the official React tutorial: easier to understand, small questions in every section, and beginner-friendly.

React is so different from Svelte that it felt like switching from Python to C++. Now that I have used React and Next for some time, I can confidently say that: Svelte is better; I would've never switched if there was even a slightly larger ecosystem and was in demand by jobs and internships. As SvelteKit approaches a stable release, companies may slowly adopt Svelte, but it will take a while. For now though, because I am looking for internships, I will be using React and Next.