React is a JavaScript library (not a framework, though it gets called that all the time) created by FaceBook and open sourced in 2014. I currently use React in almost all my projects. Why did I pick React instead of alternatives such as Angular or Vue? Why even bother with library/framework in the first place?
Why learn a library/framework? The reason to learn a JavaScript library/framework is simple: Most projects use them. It is not often you see any new website being put up that does not use some kind of framework library. Since I wanted to work in the industry It made sense to learn one. Why were people using them? Performance was one reason, React used a virtual DOM for example and was much faster than vanilla JS for many things. Less code was another. Using React you could create a re-usable component, such as a navigation bar, and use that navigation bar component across all pages on your website. Instead of each page having to have it's own HTML, you could just export your navigation bar component to each page.
The contenders. I looked at the current big three: Angular from Google, React from Facebook, and Vue from one person that turned into a team. I was immediately drawn towards Vue, not being the biggest fan of some of the things Facebook and Google had done in the past. All three projects were now open source, which was also important to me. I looked at popularity, speed, support, and documentation when making my decision.
Popularity. I hate to say this, but a major driving factor was hire-ability. There are more companies using React, and more posts on job boards asking for React developers. The trend was more interest in React, and less in other JS libraries/frameworks. I wanted to have skills that allowed me to apply to more positions, so React wins here. Vue was winning the popularity contest among developers lately, but there were still nowhere near as many people searching for Vue developers. Vue also seemed more popular outside of the North American market, where I would be searching for employment.
Speed! I always like things that go fast. I learned that React and view were faster than Angular. Angular used the real DOM, while React and Vue had a virtual DOM they used for greater speed. Vue was smallest, at around 90kb, followed by React with 120kb, and Angular which was around 500kb. Vue was winning the speed contest with React, but barely.
Support. All three seemed to have an excellent support system, though React and Vue were much more active. Looking at the Angular questions being asked on Stackoverflow, I was under the impression that most Angular developers were pretty experienced overall. The questions seemed much more high level, not as much basic stuff that could easily be found in the documentation. React was overrun with super basic questions, lots of new people learning it as their first library/framework.
Documentation Again all three had awesome documentation! Looking over them while deciding I could not say for sure which was better, but they all seemed easy to read and well organized. Huge change from some older tech documentation. All winners here!
Winner Final decision time and I was leaning towards Vue. I loved the fact that it was not the pet of Google or Facebook, how small it was, and super fast. The community seemed to really love it as well. So why did I pick React? A job search on indeed.com turned up:
- Vue: 3k open positions
- Angular: 10k open positions
- React: 40k open positions
The future Learning never stops, so as soon as I am stone cold solid with React I will be picking up Vue!