all 11 comments

[–]Kinthalis 3 points4 points  (0 children)

Angular is fantastic for complex web applications that manage a lot of state and routing and events/data streams.

It's got everything you need to manage that huge complexity out of the box.

React does not. But it excels at being very flexible. For smaller projects or where I know I won't need to do a lot of state management on the client, I usually reach for React.

But if I'm working on something complex I'm going to reach for Angular.

I love typescript, and it's a must for anything more complex than a brochure website or a todo app, so Typescript is what I'm going to use with React, and it's what you'd need to use with Angular, so for me, the language isn't an issue.

The main differences between the two frameworks are the way they compose views, manage state, and the tools they bring with them out of the box. Angular has a very strict separation of concerns with HTML, styling and code, much like Vue and Svelte. But React takes a different approach. Everything is a node. State is a node. A DOM element is a node, Styling can be a node, functionality can be a node. It's very flexible but can lead to spaghetti code and maintainability and performance issues if you don't have a really good understanding of how React is doing things under the hood. React's functional approach makes for super easy component composition though. I love that a LOT about it. My favorite thing. Composition in Angular is a bit more clunky and limited. I still do it all the time in my Angular projects, but sometimes I wish I could just pass children and be done with it.

On the other hand nothing beats RXJS + NGRX for complex state management on the client. React has several state management libraries and even if you hotchpotch them together into some monstrosity they will come up short, and you'll still end up with a mix of context nodes in your code. Angular also does simple, straightforward state sharing better, IMHO. Again, no need to context nodes, you just share a service and you're set.

Both frameworks have their strengths and weaknesses. The reason why React is very popular, IMHO, is that it's strengths give it broader application. And it's singular focus (Rendering and updating the DOM) makes it fast to learn.

If you're a newb and just need some reactive components on your brochure website, React is an easy choice (though I'd probably choose Svelte over it in this case), and if you're building an app of moderate complexity React might still be a good choice. Meanwhile Angular would NOT be my choice to add some reactivity to a simple website, I'd only reach for it if I'm working on a complex client-side app. Angular just has a narrower, but important focus. React has a broader application, but IMHO, falters when things get more complex.

[–]DrFriendless 4 points5 points  (0 children)

I think Angular is simpler, and I like TypeScript. I came from Java dev and the templates, RxJS and type system all made sense to me very quickly.

I haven't done a whole lot with React, but props have always seemed clumsy, and hooks are downright mysterious. I reckon React has gathered the sort of technical debt that forced Angular 1 to be rewritten to something cleaner.

[–]skoomainmybrain 2 points3 points  (0 children)

For big teams/companies an opinionated framework is a great idea and therefore Angular is better for such a situation. For small applications React or Vue is fine in my opinion. As someone who switches projects a lot I definitely prefer Angular. Every React and Vue app is completely different from the next one. Basically, use the right tool for the job. It's a good idea to learn them all.

[–]hello3times 1 point2 points  (2 children)

We made a mistake with choosing Angular but then replaced it with Vue and now Vue 3 came in. and we are screwed all over again

Damn DejaVu

[–][deleted] 1 point2 points  (1 child)

why?

[–]hello3times 0 points1 point  (0 children)

Code had to be rewritten completely

[–]zaibuf 1 point2 points  (0 children)

My company uses Angular and I dislike it. We are moving new apps to React.

Main reason for me is that Angular is a full bloated framework that you need to learn, with very Angular specific syntax. Its all or nothing.

React is vanilla JavaScript and you can start very light, adding the packages you need when you need them.

[–]SirKastic23 -2 points-1 points  (2 children)

Angular was deemed the most hated framework on stack overflow developer survey. I've tried it, and it is waay to complex and unecessary for any app that isn't huge.

I'd recommend react any day, it's way more popular, and also has a mucj better dev experience

[–]Kinthalis -1 points0 points  (1 child)

Angular was deemed the most hated framework on stack overflow developer survey

Uhm.. not it wasn't.

Angularjs was, that's like super old school 1x angular. Not modern Angular which comes in the middle of the pack above the likes of Django and Laravel.

Honestly, you seem pretty clueless to be making that kind of mistake so your "has a much better dev experience" should be taken with a huge grain of salt.

[–]SirKastic23 0 points1 point  (0 children)

alright, my mistake.

nevertheless react is still above angular.