Ask HN: Learn React or Vue?
[Edit: should have clarified, but I'm a solo entrepreneur. But eventually plan to hire others to mainly take over the dev work.]
I have some past experience with Vue (specifically Vue 2), but it's been a while and I've forgotten most of it. Considering Vue 3 is out and quite different, it feels almost like starting from scratch.
My initial choice of Vue was based on its ease of use for beginners, as recommended by a friend. I found it approachable, but now I'm reconsidering my options.
Here's why I'm contemplating React:
- It seems to have a much wider usage in the industry.
- There's a larger ecosystem of tools and resources available for React.
- It might be easier to find and hire people skilled in it.
- I've noticed specific tools and resources, like the low-code tool Recode and Tailwind UI templates, predominantly use React.
Given these points, I'm leaning towards React despite my prior experience with Vue. I'm looking for insights from the HN community. Which framework would you recommend for someone in my position? Any advice or personal experiences would be greatly appreciated.
45 comments
[ 6.1 ms ] story [ 96.8 ms ] threadFor me, if I were trying to get hired, I would choose React. If I were looking for my own side project or in a position where I got to choose, I would choose Vue.
I don't get the point of learning something you don't enjoy working with.
If you're building a startup go with Vue if it allows you to get up and running faster. Use React if it gives your project a distinct advantage because of a library you can access that gives you a specific advantage over your competition and gets you to market quicker.
For the record I am a Vue/Nuxt developer but in my case its because I am a solo entrepreneur and I find it easier to just get stuff done.
Job-wise React is probably the better option, in terms of number of job offers you might get.
Vue’s smaller ecosystem has not proven to be difficult in practice. I think we could benefit form importing less dependencies in our projects anyway :)
React seems hard to use, ever-changing and generally not a good option on a technical level. I haven’t used it professionally but that’s the impression it’s given me
Vue was great until the v3 rewrite where they tried to copy react hooks.
Isn't it obvious?
In my view they both can suck and shine depending on the application.
p.s. You'll be surprised how far you can get building a website with vanilla Javascript without the use of any advanced framework.
I had this argument with people a few times, and I always used to say "I could imagine writing a rudimentary version of React myself, without seeing their source code. I couldn't imagine that for Vue".
One day I decided to put my money where my mouth is, and did it. Only about 400 lines of code with all the main hooks. I'd share it here, but more to the point I'd encourage others to try it themselves instead - the code isn't the point.
Vue's docs are excellent, and I used GPT-4/Phind/Copilot (I wanted to try different solutions) when I got confused. I chose not to rewrite stuff to use the new Composition API (which is apparently analogous to React hooks) for now. I did change the build system to Vite, which is awesome, and which you can also use with React.
I don't have anything against React, except that it seems very complex and is missing basic (to Vue) functionality, the most notable being Single-File Components (which I'd miss terribly). https://vuejs.org/guide/scaling-up/sfc.html
For Vue, I think it's in the middle for me, it can be used by teams and can be used by solo devs and it seems to follow some very good practices. This I would take away from React only for the reason that each major version introduces some new concept that flips things on its head and I have feel like each new react project doesn't feel like an older one I worked on 2-3 years ago, and in some cases, not for the better.
Regarding Svelte, I wish I used it more. I built a project [1] that took me almost no time except fiddling around with github actions to get it up and running and it felt so naturally close to html/js when building, I was hardly looking up documentation or tutorials. Adding new features to it felt even more fun.
I've mainly stuck with React because of the large ecosystem but in 2024, it feels like once you find a good starting point with any of these, you should be able to build most apps with it.
Another thing to not shy away from is seeing that most large projects use React as an example, you can use something like ChatGPT to convert a react snippet to a vue or svelte snippet.
1: https://bikes.usmanity.com
I don't think that's fair. The switch from classes to functions+hooks was a significant one. Besides from that I have never felt like the React team pushed anything on me, and even that was optional, class components still work. Now, the way I write React has certainly evolved but that applies to all my code..
Fair or not, it's a prevalent enough notion to have it's own term: React fatigue.
But I honestly don't think it's that important.
Check out some alternative non-SPA style frameworks like htmx, or Hotwire. You could save yourself a lot of work if these tools are sufficient for your app’s needs.
If this is for your own projects, especially since you have some past experience with Vue 2, stick to Vue. It's simpler, the documentation is excellent, the community is great, and I found it to be more stable, fun and productive than React.
If the intent is to find a job, learn React. Even though if you have experience with a framework, you can easily pick up another one later.
Yes, that is no longer true. It is as complicated as it gets. Moreover, they killed a whole ecosystem while making the transition from 2 to 3. Go with React, I regret not doing that myself.
If it's the former: React
If it's the latter: Svelte (Especially with Svelte 5 around the corner)
Both are good, both are widely used.
Probably React. But real world code (in the form of libraries/apps/projects) is way more valuable IMO. Regardless of framework, to an extent of course. Good luck!