Angular vs React - Part 3
Which one should you pick?
Angular started it all and React is the hottest thing today. But how do they compare and how would you pick the best solution to your needs and circumstances? I will give you my unbiased (yeah, right!) opinion here.
What to consider
When picking the right solution for your project, several aspects must be considered. It is very common to come across articles from several experts that analyze speed, community, and documentation as important aspects to consider before adopting a solution out of the many competing options. This is great advice, but in addition to that, I will suggest the following three aspects that I consider are important to think about as well:
- Framework vs Library
- Surroundings
- Previous experience
In this post, I will describe what I mean by “Previous experience”. If you didn’t catch part 1 or part 2 of this series, make sure you check them out.
Previous experience
Are you a Java developer? Chances are you prefer a static and strongly-typed language. Are you a JavaScript developer by birth? Then chances are you rather work with a language that does not constraint you with types.
For the longest time, JavaScript has ruled the web development world. I remember when I started working as a developer in the early 2000s that senior developers despised JavaScript and ran from it like the plague. They’d limit its use to form related interactions or other actions where reloading the page could not offer a good user experience. Server-side web applications were kings back then and JavaScript was considered a joke.
However, over the years I learned that not every developer felt the same way. Also, those who thought this way were perhaps the least qualified to arrive at such a conclusion. Other developers decided to spend time with the language and take advantage of its good parts. Over a decade or so they were able to overcome the impossible: to flip the coin and make JavaScript, or client-side web applications, rule the world.
During the early phases of this process, I had my own reservations in regards to JavaScript. Java had been my native language for many years and I just never felt comfortable with a weakly-typed, dynamic language such as JavaScript. I learned to deal with it but was never my preference.
I had seen and even used other scripts that would transpile to JavaScript like Java (via GWT) and CoffeeScript, but none of these felt like a real solution. Then TypeScript came into the picture.
The first time I saw TypeScript happened while seeing Angular 2 code snippets. Within just a few hours, I completely fell in love with it. TypeScript offered many features I was already used to such as decorators (known as annotations in Java), strong type checking, and many more. And as I started using it, it didn’t take too many keystrokes to start feeling at home.
Angular uses TypeScript internally and supports it out of the box. When it first came out, I remember Angular offered the option to use JavaScript or even Dart as an alternative to TypeScript if they wanted. But shortly after the first release of Angular 2, these options faded into the background and TypeScript got center stage in the official documentation.
This has been my experience which gave me enough reasons to pick Angular as the language of choice over my projects. What’s your experience? If you can relate to mine, you may benefit from giving Angular a chance. If not, maybe something else like React will be most helpful to you and your project.
Conclusion
Previous experiences tend to shape future picks in most people. If you find yourself choosing the same menu item from the same restaurant, then you most likely fit into this category. Looking at the experience you’ve had with the languages you’ve worked with and comparing it against what you’d like to have in the future is probably a worthwhile aspect to explore when picking your next technology.