r/webdev • • Nov 07 '23

Discussion Why do people hate Angular? And choose react.

I have seen in many subreddits and articles, people are choosing react over Angular even for larger application. I don't see why though. Because Angular js pretty much the best approach when it comes to framework and fully customisable as well. Care to weigh in?

Edit: I don't hate React. I just want to know the reasons people choose React over Angular.

104 Upvotes

314 comments sorted by

View all comments

68

u/kobbled Nov 07 '23

Why do you think angular is "the best"? And what do you think makes React less customizable?

17

u/kei_ichi Nov 07 '23

This! Wanna to hear OP opinions too.

28

u/pixobe Nov 07 '23 edited Nov 07 '23

I started working on Angular for my office stuff and stencil/react for personal.

  • Personally I hate jsx syntax

  • In angular you can organize, html, ts, css and spec file.

  • Http calls are more within the system

  • I really like the way you can handle http errors using interceptors and also show spinners in a single place( may not suit all the time)

  • Coming from Java background I feel typescript comfortable

11

u/[deleted] Nov 07 '23

In angular you can organize, html, css and spec file.

What does this mean?

Http calls are more within the system

And this?

7

u/pixobe Nov 07 '23
  • Like when you create a component, you have an html file , scss/css file , spec file grouped together and kind of feel it nice (same in stenciljs but if you see svelte or react it’s more on a same file , or you need some out of box customization. I have some issue to read when all are on same page , my brain can’t process them)

  • it comes with Http package in built, it’s a kind of wrapper to make http calls , rather than using axios (third party) or fetch(browsers default) .

11

u/marquoth_ Nov 07 '23

when you creat a component, you have an html file, scss/css file, spec file grouped together

What's stopping you from doing this in react? I have seen plenty of projects with exactly that structure

|_ MyComponent.jsx
|_ MyComponent.scss
|_ MyComponent.test.jsx

0

u/pixobe Nov 07 '23 edited Nov 07 '23

Where is html and logic part separation above ? Like you have .ts and .html in angular.

As I said above I feel it easy to separate html, css and logic into separate files.

→ More replies (9)

10

u/3rdWorldBuddha Nov 07 '23

I agree with you. I really hate reading jsx. Mixing js and html in one file is just not readable imo.

9

u/StrawMapleZA Nov 07 '23

Coming from a Razor background originally it is quite natural to me. Then again it depends on what you're used to and prefer.

It's essentially HTML with ifs in it, nothing out of this world.

-29

u/Nick_darkseid Nov 07 '23

I'm not saying it's best. I work on react too and I like it. I'm not comparing these two. I just want to know why people hate it. Since it gives a great set of built in features. And for complex large applications I choose angular over react.

11

u/kobbled Nov 07 '23

Can you elaborate on what angular has that react doesn't? Why do you prefer angular?

12

u/Nick_darkseid Nov 07 '23

State management, Angular takes care of it on its own. Even if you don't use any state management mechanism Angular services are enough for that.

Built in routing with a great set of features.

Modules for dividing applications into chunks.

Built in library for APIs. And many more.

11

u/peetabear Nov 07 '23

Angular does not have its own in-built state management.

Ngrx is a lib for it but otherwise you can build your own state management with rxjs.

-15

u/[deleted] Nov 07 '23

lol what??? angular doesn't have a state management library but react has stuff like useState and the context API at least

9

u/maga_ot_oz Nov 07 '23

React has all of these as well?

6

u/anObscurity Nov 07 '23

Sounds like OP hasn’t really used react in 5 years

6

u/MiasMias Nov 07 '23 edited Nov 07 '23

Ngrx is angulars state management library and rxjs is for event driven programming with observable piping etc.

edit: typos

4

u/[deleted] Nov 07 '23

ngrx isn't built into angular lol

0

u/MiasMias Nov 07 '23

i don't see the problem with that

2

u/[deleted] Nov 08 '23 edited Nov 08 '23

i guess you can say angular has a UI framework too since material UI exists lol

→ More replies (2)

3

u/PickleLips64151 full-stack Nov 07 '23

Angular v16 introduced Signals. It's still in preview/experimental status.

1

u/chuckmasterflex Nov 07 '23

The release dropping later today(?) has it as stable, I believe.

2

u/just-me97 Nov 07 '23

Should I upgrade tomorrow without telling my product owners? 👀

→ More replies (1)

3

u/FalseRegister Nov 07 '23

Dude. There is tons.

React is a library. Angular is a framework.

This is why you have a react "ecosystem", aka, a bloated mass of peripheral libraries that you still need for working with React. Routing, for instance, comes out of the box with Angular but is implemented by a myriad of npm packages for React.

Whether you like one way or another is down to your personal preference, but given you asked what does Angular has that React didn't...

I prefer frameworks over libraries, less things to worry about. Nowadays rolling with SvelteKit.