DEV Community

Discussion on: High level view and logic separation in React

Collapse
 
severityone profile image
Peter Korsten

What I'm wondering, as primarily a Java developer (but I started programming in, um, 1982) with some Angular experience, is there still a lot of difference between React and Angular once you add separation of concerns and various libraries to the former?

The reason why I'm asking is because I'm looking at replacing our ageing frontends, like those in JSF, by something a little more modern, and that basically comes down to either Angular, React or Vue. (Being able to run it on a mobile device is another consideration, so NativeScript seems the logical choice there.)

I know all about mixing presentation and business logic (need I say JSP?) and what it means if developers can mix the two: they will. And you end up with an unmaintainable mess. We do long-term projects with incremental updates, so maintainability is very important. That's my biggest concern about React.

On the other hand, Angular has a lot of qualities, but simplicity isn't one of them. And we do have limited resources, so getting everybody on board with Angular... I'm not sure that is going to happen.

Which leaves Vue, but I know very little about it.

I'm not looking for the best framework. What I'm looking for what's best for the company I work for. And I haven't figured that one out yet.

Collapse
 
tomekbuszewski profile image
Tomek Buszewski

Hey Peter!

From my perspective, Angular is a great choice for enterprise-grade applications. If you have a really large team that can adapt this easily – go for it. Learning curve is steep, but it really is a framework. You're getting everything, routing, http service, whatever.

React, on the other hand, is more of a "all 'round" library, it works great with small companies (like the one I work for now) and big ones (like the one I was working for last year). But it comes with a cost – you need to choose (and stick with your choice) everything. HTTP module? Router? Application state management? All of these are vendors. React just renders the UI (and does it pretty great).

Separation of concerns as an architectural pattern is framework-agnostic and can be applied to either Angular or React. It's a leader's role to maintain the code quality on the big picture. If you, as a lead, decide that logic and view needs to be separated (and boy, they need to be!), you should stick to it and make your team understand why.

With all that being said, I'd go with React, since it has way smaller learning curve and can be scaled pretty well, while Angular is already scaled when you begin.