What are the differences between React and Vue.js? ft Sara Vieira | Prismic

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
- So Sara, we talked about, in the first video, we talked about several frameworks, you know, React, Vue, Angular, as well-- - We didn't talk about Angular. - We mentioned it right? - It's there. - It's there, always. So one thing I wanted to ask you about is what actually are the differences between React and Vue? Often, like we hear a lot from our users and from other people that it's not clear for them why they should be trying one or the other. And often people like, will choose one and they will go for it for the rest of their apps. So and you know, when you're learning a framework, it's a big decision, right? You're going to spend quite some time learning that framework. You don't want by the end to discover like, whoa, it was the wrong choice. So how can you help them with that? - I think one of the things that you need to take a look is what syntax you like the most. Like, I know plenty of people who really dislike Vue. Like, for example, Kitze, because he hates templates. Which is a valid thing. He probably had a really traumatizing experience with handlebars or something like completely valid. I mean, I get that. So if you're the type of developer that really doesn't like templates, I would say to avoid Vue. They do render through JSX, but it's not very well supported. So like, there's no reason for you to like, force that thing into it. Just try React. There's another thing which is for example, React, focuses a lot on immutability. Well, Vue focus a lot on reactivity. So for example, when you have state in React, you can't just say like, you can setState() just completely change the state you have to like, if you want to get everything, it just basically maps everything and it's immutable. Most of the times. Like it kind of forces you to be immutable. While you have to set- you can just say like, this or so if you have a state of Todo you can just say Todo equals a new array, you have to set Todo and then you have to spread all the Todo that you have and all that stuff. While in Vue, it works in reactivity. So basically just say like this.Todo equals the new array that you have. It does all of the magic that React does but behind the scenes. So if you're a person that really dislikes that type of boilerplate, for example, I don't, I've never liked Redux, because of a lot of boilerplate that it creates, I prefer to have something more reactive so at CodeSandbox, for example, we use Overmind, which is way more reactive than Redux. It's, it's like it's more magic, but I preferred it because Redux just just so many files, man. So many files. - And so many maybe also decisions to take by-- - Exactly so it also doesn't work by its own. That's a big problem that we're seeing in the community right now, I think is like, everything is plugin based or middleware based and Redux is very confusing to get started, because then you don't have like async action, so then you have to put a middleware on it, and then you get stuck in the middleware route and then you have like this, like the high order components. - So if you want like maybe to control how the state is getting like into the components, maybe React is a good choice if you like to have that control, right? - Yeah, I feel like React is a good choice if you come from a lot of CS backgrounds as well, because it applies a lot of CS stuff in the front end. Or if you like functional programming, I think React is way more functional than Vue is, which is not a bad thing. Like it's both completely valid. Vue I feel like it's more geared a lot through people who really just wanna build things. - Just get things done. - Just wanna get things done. Like I feel like there's a huge difference between the React and Vue community mostly in like, the React community really likes to explain the code and like, name things and things like that, while the Vue community just sitting there and is like, I just wanna build stuff, and they just build a lot of stuff. Like a lot of it also depends on like, which part you fit most in like in this kind of spectrum a bit. Like, for example, it's way more common to use TypeScript in React than in Vue, because of the lot of the differences in the community as well. There are some people trying to use it in Vue, But they're mostly the outcasts of the opposite in React. And also, there's a thing of if you're starting out the Vue docs are really good. The React docs are getting really good as well. The Vue docs are really good. And they're like, really easy to get started. The thing that I feel that that keeps me like doing React is the there's a big community in React. There's also a big community in Vue. And I really liked JSX. I think JSX makes a lot of sense to make components. And I also really like CSS and JS. So I kind of got stuck in the wheal of React. As in like, I use a lot of CSS -- I use Styled Components or Emotion. They're basically the same thing now. And again, I got stuck in the, in the trolley. And I feel like React is more like blocky than Vue is to create components and stuff like you can still do it in Vue, but I feel like it takes more work to do it than in React. Like it's not common practice for example to pass functions up. Things like this are not a thing in View. They exist, but you're basically forcing it. So I think it really depends on which side of the spectrum you are like none of them are wrong. There's just different ways of building the same thing. - So does it depend only on the person or also on the project they are trying to do? - I think it also depends a bit on the project, but not that much really. I feel like both frameworks can do... You can make something in React or in Vue, and you can make it the same way. There is no like clear-- - Sweet spot. - Yeah, no, there's no clear like, this is better for this. Not really. - Like if we imagine like doing, start with a website, a pretty rich website. Both are okay for that. - Yeah, I would say either use Next or Gatsby. Nuxt or Gatsby, yeah. - Now if someone is starting with like, they want to learn one of the frameworks. Does it mean that they should rather maybe try Vue because it's easier to start with is easier to learn now it's not the case anymore. - I think it's still the case. But the main issue is that a lot of us learn to get jobs and there's a lot more jobs in React, so you end up also with this paradigm. - Oh, there's that, yeah, yeah. - Yeah so you end up with this paradigm, which I've told people to learn React mostly because of the jobs but I do think Vue is easier to get started but it will be harder for you to find a job in it. And there's also the good thing that I think the Vue community has a lot is that if you get a job in Vue they will teach you Vue for example. - Oh yeah, cool, okay. - Yeah, like a lot of people that joined GitLab, already used React, for example, and they have to be taught a bit of Vue, which is fine. I do think that in an ideal world where money wasn't a thing, I would say you get started with Vue and you see if you like it, if you don't really like it, you use React and you try a bit of both. But you get started with Vue because it gets you the ideas of a framework but in an easier way I think easier to manage way. - But do you think whatever you will learn when you're learning Vue will help you understand React? - Yeah, it will. Like for example like it will because you still have state. You still have functions that you call from the render function. It's just a different way of doing it. - Cool, okay, I hope that will be helpful for people. - I hope so. - I basically just said it "It depends", no I didn't. (chuckles) Did I say it depends? - But you gave some information. - Should you use React or Vue, it depends. (laughing) - The magical question. - Yeah, the magical answer.
Info
Channel: Prismic
Views: 36,506
Rating: undefined out of 5
Keywords: React, Vue.js, JSX, CSS, State, CSS in JS, Styled components, Documentation, Community, Learn, Sara Vieira, Prismic, yt:cc=on, React vs Vue, differences between React and Vue.js, React and vue, Prismic Interview, Web development, learn web development, dive into web development, Font end developer
Id: 1oK8AvSlXyM
Channel Id: undefined
Length: 7min 26sec (446 seconds)
Published: Thu May 07 2020
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.