TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Ask HN: Learn React or Vue?

14 点作者 pottertheotter超过 1 年前
Which front-end framework would you learn: React or Vue?<p>[Edit: should have clarified, but I&#x27;m a solo entrepreneur. But eventually plan to hire others to mainly take over the dev work.]<p>I have some past experience with Vue (specifically Vue 2), but it&#x27;s been a while and I&#x27;ve forgotten most of it. Considering Vue 3 is out and quite different, it feels almost like starting from scratch.<p>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&#x27;m reconsidering my options.<p>Here&#x27;s why I&#x27;m contemplating React:<p>- It seems to have a much wider usage in the industry.<p>- There&#x27;s a larger ecosystem of tools and resources available for React.<p>- It might be easier to find and hire people skilled in it.<p>- I&#x27;ve noticed specific tools and resources, like the low-code tool Recode and Tailwind UI templates, predominantly use React.<p>Given these points, I&#x27;m leaning towards React despite my prior experience with Vue. I&#x27;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.

39 条评论

muhammadusman超过 1 年前
I&#x27;ve built projects using React, Vue, and Svelte in the last year. All 3 are great in their own lane. React is a great starting point for larger teams to add on things to and it does start to be come its own beast within large teams.<p>For Vue, I think it&#x27;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&#x27;t feel like an older one I worked on 2-3 years ago, and in some cases, not for the better.<p>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&#x2F;js when building, I was hardly looking up documentation or tutorials. Adding new features to it felt even more fun.<p>I&#x27;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.<p>Another thing to not shy away from is seeing that most large projects use React as an example, you <i>can</i> use something like ChatGPT to convert a react snippet to a vue or svelte snippet.<p>1: <a href="https:&#x2F;&#x2F;bikes.usmanity.com" rel="nofollow">https:&#x2F;&#x2F;bikes.usmanity.com</a>
评论 #39004837 未加载
rmason超过 1 年前
It really depends for whom you are doing the coding. If you&#x27;re a corporate contractor or wish to work as a developer in the corporate world you will have an easier time learning React because as you stated it is far more common.<p>If you&#x27;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.<p>For the record I am a Vue&#x2F;Nuxt developer but in my case its because I am a solo entrepreneur and I find it easier to just get stuff done.
评论 #39004830 未加载
CharlesW超过 1 年前
From the POV of a former Vue 2 user: I just migrated a small-ish project from Vue 2&#x2F;JavaScript&#x2F;PHP to Vue 3&#x2F;TypeScript&#x2F;serverless after a couple of years of not touching it, and the process was straightforward.<p>Vue&#x27;s docs are excellent, and I used GPT-4&#x2F;Phind&#x2F;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.<p>I don&#x27;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&#x27;d miss terribly). <a href="https:&#x2F;&#x2F;vuejs.org&#x2F;guide&#x2F;scaling-up&#x2F;sfc.html" rel="nofollow">https:&#x2F;&#x2F;vuejs.org&#x2F;guide&#x2F;scaling-up&#x2F;sfc.html</a>
noud超过 1 年前
My recommendation would be to first learn vanilla Javascript. Become experience in it (I&#x27;m assuming you&#x27;re not a Javascript expert yet). Build a couple of websites with vanilla Javascript. Then, move to a framework. First, it&#x27;s much easier to learn these frameworks when your foundations are strong. Secondly, you&#x27;ll better understand how the framework works under the hood. Thirdly, you understand better why a framework is used, and what it tries to solve what vanilla Javascript cannot (easily) do.<p>p.s. You&#x27;ll be surprised how far you can get building a website with vanilla Javascript without the use of any advanced framework.
unifyjs超过 1 年前
What is your preferred programming style, are you more comfortable with an object oriented or functional approach?<p>Vue is entirely &quot;class based&quot; and matches more closely with an object oriented style. It is heavily based on the mobX (previously knockout.js) approach to reactive properties on objects.<p>React, at least the more recent iterations, works best using function components with hooks and adheres to more of a functional programming paradigm (though you can still use class based components, these are no longer what the react team recommend).<p>After many years of playing with both React and Vue, I personally much prefer a functional approach and prefer React. The &quot;top down&quot; data flow is much more predictable and easier to debug than having derived properties that are dependent on other derived properties that are dependent on other derived properties (etc... you get the idea).
smokeydoe超过 1 年前
React. Its way easier to hire for. It has a much larger support community and tool ecosystem.<p>Vue was great until the v3 rewrite where they tried to copy react hooks.
评论 #39004584 未加载
metaloha超过 1 年前
If you go for React, remember you&#x27;re learning a UI library and not a framework. You&#x27;ll need to learn a number of different libraries in order to use React in a framework, and with a multitude of choices for each portion of the framework functionality.<p>The problem with React - and to a lesser extent Vue - is that each project will likely use different libraries for similar functionality. There are some very popular defaults for many (like routers), but you&#x27;ll still end up needing to be familiar with more than one.<p>You could look at Next.js which is a React-based framework.<p>Between Vue and React, I&#x27;d go with Vue. It has the same problems with multiple options for every framework aspect, but most of it is Vue-branded (so to speak) which means you&#x27;re less likely to need to learn alternatives. I also think it makes more conceptual sense than React, but that&#x27;s a personal opinion.<p>If your interest is to become employed, React is definitely more popular - but it&#x27;s not better.
robocat超过 1 年前
This article on how changes to application state propogate to the UI in the different frameworks is perhaps relevant: <a href="https:&#x2F;&#x2F;themer.dev&#x2F;blog&#x2F;the-single-most-important-factor-that-differentiates-front-end-frameworks" rel="nofollow">https:&#x2F;&#x2F;themer.dev&#x2F;blog&#x2F;the-single-most-important-factor-tha...</a>
casper14超过 1 年前
I have experience with both, but will always opt for Svelte if I had the choice. In practice your employer will likely make you use React anyway if you code professionaly
wirahx超过 1 年前
The only reason React et all need an ecosystem is because they&#x27;re hard to integrate vanilla libraries with, or harder to develop components for.<p>Vue suffers less from this issue, as you&#x27;ll well know, and Svelte doesn&#x27;t suffer at all.<p>The same can be said for people being skilled in it. It takes longer to skill up on React, less on Vue, and the least on Svelte.<p>A lot of people end up using React because of these invented scenarios, when in reality, building something rapidly like a start-up is significantly quicker with Svelte. Trust me, I&#x27;ve done it, and we&#x27;re post Series A, and now reaching profitability.
sailorganymede超过 1 年前
I chose React because it really made life much easier when it came to reusing components and organising my projects. I find bare bones React the right level of complexity for me and I can get a lot done with it
jacobsenscott超过 1 年前
First of all, they are both just javascript - so to say you are &quot;learning from scratch&quot; isn&#x27;t accurate - you must already know js. Second - choosing a tool based on &quot;what is best for beginners&quot; not a good way to choose a tool. If you are using something daily you&#x27;ll only be &quot;beginner&quot; for a few weeks, intermediate for a year or two, and expert for many years (assuming you continue to work in that space). So choose the tool you enjoy using the most, and is a good &quot;expert&quot; level tool.<p>React and Vue are both quality &quot;expert&quot; level tools, so you should choose based on other criteria. If you really need a job go with react (there are 4x more react jobs than vue jobs on indeed in my area). If vue really clicks with your style of thinking maybe go with vue.<p>Finally just pick one and get started. They really aren&#x27;t that different, and if you are in the industry long enough you&#x27;ll learn many languages and frameworks. Also I would be surprised if React or Vue stay popular much longer - though there will always be work on legacy apps (hello cobol, php, spring, .net, rails, ....) Also the more experience you have the faster you can learn new things. It doesn&#x27;t matter much which is you first - you aren&#x27;t getting married!<p>As for personal experience, I&#x27;ve used both lightly. For each, after a few hours of going through the docs&#x2F;tutorials I was productive enough to get work done in a production application. Often my code was better than the &quot;experienced&quot; front end devs because I have 20+ years of generalist experience, and I actually read the docs (you would be surprised how many full time react&#x2F;vue devs have never read the documentation - just learned bits and pieces on youtube, etc).<p>They are both pretty simple. The complexity mostly comes from the users of the frameworks adding unnecessary complexity to their own applications due to bad architecture, not fully understanding the frameworks (didn&#x27;t RTFM), and trying to push the frameworks beyond their sweet spots.
ringofchaos超过 1 年前
My personal experience is with React only and I was in similar position as you a couple of months ago.<p>I picked up react due to similar reasons as you stated and I am happy with my decision so far. Was able to build quite a complex web app as solo developer with React and Vite.<p>However there are some quirks about it, due to it being an older frameworks and many parts of it are not intuitive.<p>This is mitigated by fact that many good resources are available.<p>However if I was to start new project I would choose svelte as i like how it is more intuitive to use. But I would not pick up this as my first framework, hence chose React so that I can get comfortable with frontend development.<p>One advise though whatever frameworks you choose, start with typescript it will make your development so much better
AndrewOMartin超过 1 年前
Just watch the video from ReactConf 2018 where hooks are introduced (by the dude who built them). You can play along at home quite easily by getting started either with &quot;npx create-react-app myApp&quot; or a simple html file with one script tag to download react from a CDN and one script tag for your code.<p>Talk: <a href="https:&#x2F;&#x2F;youtube.com&#x2F;watch?v=dpw9EHDh2bM&amp;si=6TyFab5RYKV1RwEY" rel="nofollow">https:&#x2F;&#x2F;youtube.com&#x2F;watch?v=dpw9EHDh2bM&amp;si=6TyFab5RYKV1RwEY</a><p>By the end of the talk you&#x27;ll probably be leaning towards &quot;this sounds cool, I&#x27;d like to play around with it&quot; or &quot;that sounds like cursed incantations for the damned&quot;.
ayhanfuat超过 1 年前
&gt; My initial choice of Vue was based on its ease of use for beginners<p>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.
the_gastropod超过 1 年前
As others have noted, it depends on what you’re looking for. But it kind of sounds like you’re starting something new &#x2F; anticipating hiring more developers. If this is the case, I’d suggest getting really honest about your needs and whether they point to a front-end framework at all. Recognize the significant cost the SPA architecture imposes. It’s worthwhile at times. But more often than not, in my experience, it’s a wholly unnecessary expense.<p>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.
speedgoose超过 1 年前
You could learn both and also Svelte if you feel like it, and then use react.
athanagor2超过 1 年前
Vue 3 follows a similar approach to Vue 2 (reactivity on objects, translates automatically to DOM updates). Although there have been some syntactic changes (such as the composition API).<p>Job-wise React is probably the better option, in terms of number of job offers you might get.<p>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 :)<p>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
jitl超过 1 年前
React is the industry standard right now, to the point where it inspired the official UI frameworks for iOS and Android. I’d recommend it on that basis to some extent, but I also think React’s concept of UI snippets as values you can pass around like anything else is quite powerful and I miss it when working with template-only composition frameworks like Vue. If you learn it, it’s also a useful comparison point when learning other frameworks later - and there’s plenty of resources out there that explain other frameworks in React terms.
KerryJones超过 1 年前
I think the answer is unique to your situation. I&#x27;ve seen and read many experiences of those who have both used React and Vue (including myself), and <i>many</i> prefer Vue. That said, <i>because</i> React is more popular, this is going to get your foot in the door in many more companies, and it&#x27;s a bit of a &quot;well everyone is using React so we will too&quot; type of spiral.<p>For 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.
llimos超过 1 年前
I find React easier to reason about, which is a big advantage for me.<p>I had this argument with people a few times, and I always used to say &quot;I could imagine writing a rudimentary version of React myself, without seeing their source code. I couldn&#x27;t imagine that for Vue&quot;.<p>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&#x27;d share it here, but more to the point I&#x27;d encourage others to try it themselves instead - the code isn&#x27;t the point.
joduplessis超过 1 年前
Assuming an entry level job?<p>Probably React. But real world code (in the form of libraries&#x2F;apps&#x2F;projects) is way more valuable IMO. Regardless of framework, to an extent of course. Good luck!
评论 #39004838 未加载
pjmq超过 1 年前
Are you looking to get a job with your framework of choice? Or are you looking to build stuff for yourself?<p>If it&#x27;s the former: React<p>If it&#x27;s the latter: Svelte (Especially with Svelte 5 around the corner)
评论 #39004847 未加载
chuckadams超过 1 年前
My opinion: Vue, specifically the Vue 3 Composition API. Most of your UI state should come from computed() values. Bookmark <a href="https:&#x2F;&#x2F;vueuse.org" rel="nofollow">https:&#x2F;&#x2F;vueuse.org</a> and come back to it often. Go through VueUse&#x27;s source (the docs for each function link to their source): you&#x27;ll be surprised at how simple most of it is, and it works as documentation of best practices for using the composition API in general.
citrusx超过 1 年前
Why not both? Not at the same time, of course.<p>Neither is exclusive of the other. I&#x27;d start with React, since it&#x27;s 80% of the market. But, once you feel comfortable with that, move on to learning Vue.<p>Also, it&#x27;s worth it to consider looking at Svelte. If anything is going to take a chunk out of React&#x27;s market share in the future, it will be Svelte or something that looks like it.<p>Remember that there&#x27;s no limit to what you can learn, one step at a time.
jedisct1超过 1 年前
It depends on <i>why</i> you need to learn a framework.<p>If this is for your own projects, especially since you have some past experience with Vue 2, stick to Vue. It&#x27;s simpler, the documentation is excellent, the community is great, and I found it to be more stable, fun and productive than React.<p>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.
leros超过 1 年前
They&#x27;re both fine but the larger React community makes it more interesting to me. More online support, more libraries, more jobs, etc.
make_it_sure超过 1 年前
Vue has enough job opportunities. Is also more fun work with than React. Vue 3 with script setup is much easier and efficient than React.
Gow8876超过 1 年前
If you are web developer, you are expected to know both up to working-criticizing level. However, if you are just starting or noob in both, Vue is better to take on. After that, do Nextjs. Then go React. But of course, depend on your job. If you job demand React now, then React it is regardless what HN tells you.
jvans超过 1 年前
What are you trying to build? I would personally avoid JS if i was in startup&#x2F;scrappy mode and stick to server side rendering. It can take you very far and reduces a lot of complexity. Most apps don&#x27;t need to be single page applications
Glench超过 1 年前
I think your reasoning about React is very sound. Also, personally, I only use Svelte in my projects. I love it so much more than React (and I think the performance is a lot better because no vdom). Sometimes love overcomes reason :P
locallost超过 1 年前
If you&#x27;re only learning for a job, React. Or at least check job postings in your area and see how it looks like. If all of them are React, then why learn Vue?<p>But I honestly don&#x27;t think it&#x27;s that important.
dncornholio超过 1 年前
If it&#x27;s your first framework, it doesn&#x27;t matter which one because you have to learn how to learn first. If it isn&#x27;t, learn both and I would add Svelte and Angular.
aristofun超过 1 年前
Asking &quot;why&quot; or &quot;which&quot; questions should always start with the end goal in mind.<p>Isn&#x27;t it obvious?<p>In my view they both can suck and shine depending on the application.
ipaddr超过 1 年前
I was worried about moving from vue2 to vue3. You can still write in vue2 style but once you move to the composition api you won&#x27;t go back.
etchalon超过 1 年前
I&#x27;d learn both, or at least start to, and find the one you like best.<p>I don&#x27;t get the point of learning something you don&#x27;t enjoy working with.
andrewstuart超过 1 年前
You should try both and use the one that makes you happy.<p>Both are good, both are widely used.
baq超过 1 年前
Both and Svelte.
dist-epoch超过 1 年前
Vue is better, but it&#x27;s also dead.<p>So learn React.