Hacker News new | ask | show | jobs
by montroser 1358 days ago
The two frameworks take completely different approaches to solving similar problems, so each comes with huge trade-offs compared with the other.

In a sense, the Svelte framework runs at compile-time -- it takes your application source code, and uses its framework to produce a minimal JavaScript bundle that you ship to your end users.

In contrast, the React framework runs at run-time -- you ship React along with your application to the end user, and they boot it all up and run it there.

So, in terms of benefits, Svelte will be smaller and will likely run faster. As a bonus, it's much easier to learn.

For downsides, Svelte can be harder to debug, and the community is smaller. But that said, React is a hot mess with so many ways to do all the things because all the existing ways are terrible and so then people make even more new ways again...

1 comments

Thanks a lot for the feedback. I am starting to get serious about learning the frontend side of things (coming from a backend/DevOps professional background). Especially the part of "React is a hot mess with so many ways to do all the things..." has made me prefer Svelte over React, and I really enjoy Svelte's idiomatic way of handling reactivity, I find it super intuitive. I guess I was just feeling insecure about putting so much time into Svelte, because I mostly only hear about people working with React.
Yeah, at this moment there is a lot of momentum behind React, and so there are lots of jobs/opportunities out there.

But just like jQuery had its time, and Angular, so too will React fade. And we will look back and think, "whoa that was crazy".

Svelte's surface area is small enough and sane enough that I wouldn't feel bad investing there. You can just spend time getting stuff done instead of obsessing in React land about useEffect vs useCallback and nesting components 20 levels deep etc.

If you want to keep the sanity of Svelte but go for a larger job market and community, Vue is also a pretty good option.