- React you can visit the react homepage here
- Vue, you can visit the Vue homepage here
- Angular, you can visit the angular homepage here
- Svelte, visit the svelte homepage here
Let us take some time to look at each of these frameworks in turn and see what they offer and the drawbacks attached to them.
- React has a short learning curve and if you are a fast leaner, inside a 2 weeks to 3 weeks, you should be able to build simple UI's with react.
- React allows you to chose the pattern you are going to implement in building your web app, MVC, MVM, MVVM etc.
- Since react is the most used frontend framework, there is no shortage resources to learning react, and jobs that require skills with working with react are quite easy to find.
- React supports both functional based and class based components, if you are not comfortable using a class based component, you can also use functions as components and i used stateless functional components a lot.
- Building large complex web apps with react can easily become a nightmare, since there is freedom to choose your structure, things can easily get out of hand if not carefully thought out.
- React supports a one directional flow of data, that is only parent components are allowed to pass data to their children component and not the other way around.
- JSX can be make your head spin for a few hours if you are new to it.
- Easy to learn, active community of developers working to improve and develop the framework. It is easy to find resources where one can learn and the docs is a great place.
- Vue is a mix between angular and react thus it incorporates some of the best of both worlds, it doesn't matter what background you are coming from, react or vue or no background at all.
- It is easy to extend and incorporate your own custom directive/filters to allow for more customized declarative style template.
- Vue lacks the robustness of angular and cannot be used to build advanced front end projects.
- Working with assets like external stylesheets, fonts and images can be a nightmare for a beginner.
- Declarative HTML template which is made possible by via angular directives, Reactive x (Rxjs) programming using observables which are super cool.
- Two way data-binding is a breeze, you can bind data to HTML attributes and events, and you can also fire a custom event.
- TypeScript usage allows you as a developer to take advantage of all the cool features that TypeScript provides in your angular application.
- Dependency injection, this allows keep components and methods separated from each other, supporting a MVC approach.
Long learning curve as one has to learn some extra things like TypeScript and Rxjs first before one can become proficient with angular.
Build bundle size is quite big compared to other frameworks significantly affecting load times.
- Svelte is a compiler and it will only compile and bundle your code, it doesn't ship along the svelte library thus apps built with it are faster.
- Svelte syntax is easy to learn and has shorter LOC compared to other frameworks.
- svelte is quite new thus it lacks some the community of angular, vue or react.
- Jobs that require svelte as a skill is not so common.
It is to point out that all these frameworks discussed above are just different ways to do the same thing, so just which one might be best to learn in 2021? let's look at a few things to consider before we can pick one
- The time curve that it will take you to learn the framework.
- The community behind the framework and availability of learning resources.
- The amount of jobs that require the knowledge and skill working with the framework.
I think to me these are the most important things to consider when choosing a frontend framework, avoid comparisons between them as this might make you miss out on some cool features that they posses, rather pick one and learn that one properly then you can move on to another.
I cant choose for you so sorry, you have to make your own choice but i hope that i just made a little contribution in making that choice easier for you. For me i learned React in 2021 and i'm enjoying building web apps with it, check out this Todos app i made with react.