/ #AngularJS #Javascript 

The key problem that AngularJS solves (and React does not)

Software exists to solve problems for people.  Software frameworks exist to solve problems with developing software.  Reflecting on the hype and excitement around React, I thought it was a good time to think about the key problem solved by the AngularJS 1.x framework and contrast that with the React framework.

Web design and coding are different HTML and CSS are fundamentally about visual layout, look and feel.  To be good at these, you need a sense of design and a lot of patience.  Coding data access, UI interaction, callbacks and form validation is a completely different discipline and there are not many people that are productive at both of these.

AngularJS solves this problem by providing a clean separation between the two disciplines.  A developer can take a completed HTML/CSS layout and ‘tag it up’ to make it interactive, a designer can refactor the visual layout of a page without messing about with the code.

React does not solve this problem at all and requires you to ‘cut up’ the HTML/CSS and emit it to the framework from the code. Inevitably, this means that to be productive at coding and refactoring your React solution, you need to be productive at both disciplines.

Not every developer is a Front End developer I have introduced AngularJS to development shops with no specialist front end developers at all. We needed to use a consultant to build the initial framework and build some components for us but that having been done, my team of backend Java developers were able to crank out a lot of UI and were very productive at it.

This worked because we were able to use a stock standard CSS approach (we used Bootstrap) and the HTML could be safely cut and pasted from templates and already existing applications and let our coders do coding.  The separation of concerns inherent in AngularJS made this possible.

React code is spaghetti code

Just going through the tutorial, I found myself hunting around in the code, looking for where a particular piece of code or feature was.  It might just be unfamiliarity with the approach but the code just looked like spaghetti to me and I have serious concerns about productivity and the cost of refactoring.

MVC was created for a reason The MVC pattern and all of it’s variants work because it offers a clean separation between the layers, a separation of concerns.  React is smashing these things back together and this seems like a backwards step to me.

Author

Michael Dausmann

Full stack developer. Agile, Data science and Machine Learning. Love learning, speaking and dad jokes. Tweets are my own.