Which frontend framework should you learn in 2021
Well, let’s take a look at two front-runners angular and react. we’ll break it all down compare the two and I’ll tell you which one I think is the best. I will brief on React vs Angular .
React VS Angular
Angular is a framework that was created by google still is maintained by Google. It’s very structured it uses typescript which is actually pretty interesting and kind of cool. They have a new version of angular out every six months. They’re pretty committed to that they’re at 12 right now.
On the flip side of that, you have React which is created by Facebook it’s a lot more lightweight and in terms of code not necessarily in speed but in terms of like code because there’s not as much built-in. And some of that makes it really easy to get started although typescript is really nice and angular it’s another thing for people to learn to be able to get into angular we’ll talk more about the learning curve here in a second but react is pretty lightweight and pretty easy to get started.
Now I do want to make one clarification there is a big difference between AngularJs and then Angular two three four five or two four five six seven eight nine ten I guess they skipped a few in there and the big difference is AngularJs was kind of the original version of angular. It was a lot more similar to something like Vue is today and angular really bet on the future of what web development frameworks would look like and they made this big migration to angular two and then four and then some numbers all the way up to twelve so if you know what I’m talking about today is angular 2 plus not AngularJs. So if you see things for AngularJs it’s a completely different topic, not something we’re talking about today
So let’s dive into some of the built-in features. let’s start with angular as a whole has a lot of stuff built-in and you get into lots of debates about framework versus library a lot of people consider. Angular to be a framework and react to be a library because angular does come really pre-packaged with a lot of things such as application development process, they have an HTTP client, they’ve got services that can do some of the business logic for you. It has a lot of structure there’s a pretty opinionated structure on the file setup and when you create components what the file structure looks like and all that sort of stuff in angular then there’s also built-in routing so they’ve got a router built-in as well and one of the things I really like about angular is the scaffolding so the angular CLI comes with commands to generate components for you. When you generate a component, for example, it gives you a CSS file, HTML file, a typescript file as well as a test file so all of that stuff being like kind of given to you one is really nice.
I kind of like that angular is opinionated because I don’t really have to think about my structure whereas React is completely opposite. In React you basically have to get extra packages for almost everything that you want to do a big example of that would be for routing. Routing is not built in React. You have to get a package for that react-router dom being a common one and then things like state management are things that you’d pull in like Redux. You can also use the context API when you get into bigger applications. Redux is a popular one there and that is only fair to mention that people bring in outside packages for state management and angular as well when they want to if they have a preference and they have experience but angular just has a lot more built-in. React is pretty minimal and then because of that, you have to pull in outside things