Getting started with React

This last week React and I got to know each other a bit. Considering React’s popularity, it was fun to see what all the hubub was about. I’ve worked with Angular in the past, and was surprised to find them to be quite different. There are a few major differences I hoped to outline here.

First off, I was surprised to learn that React is not a framework. At least not in the same sense as Angular. There is a lot more flexibility with how React is structured – for better or worse. Personally I prefer the very structured model-view component build to the ad-hoc JSX/function structure of React. It is easy to see why React is popular though. It is accessible and quick to spin up a basic app.

Second, Angular uses Typescript where React typically uses JavaScript (though you could probably set it up to use TS). I am a huge advocate of Typescript. I used to join in on the JS jokes and frankly avoided it where ever I could. Typescript changed my opinion of JS 100%. It eliminates the ambiguity that can sometimes be found in JS. It is an incredible tool for maintaining high quality code in large teams. Not only does it force the writer to explicitly say what type of data is expected at different places, but also improves readability for teammates who come behind.

Ultimately, Angular has much stricter requirements for how to write code and build components when compared to React. Personally, I believe these enforced requirements encourage better code quality. This structure also makes it easier for people familiar with the framework to quickly make sense of what things are doing. This enforcement comes at the cost of accessibility though, and React is certainly easier to pick up and quickly get started

Leave a comment

Your email address will not be published. Required fields are marked *