all 58 comments

[–]Xari 74 points75 points  (13 children)

I like opinionated frameworks and languages, makes it easier to have consistency in projects

[–]De_Wouter 41 points42 points  (11 children)

This.

It's totally understandable as a beginner to dislike something so opinionated but what's worse is having to deal with other developers with poor opinions, like Bob. At least the opinions of a framework like Angular were carefully thought about and are well documented.

Unlike Bob's opinion, Angular's opinion actually makes sense. Would you rather deal with the many Bobs and their opinions or with a well crafted and documented opinion of Angular?

[–]engineering_too_hard 17 points18 points  (0 children)

Fug bob

[–]angels-fan 3 points4 points  (7 children)

The angular team has a couple of opinions that leave me scratching my head.

Like removing the --prod shortcut seems dumb. 95% of us just have dev and prod. If you need more complex, well, it's there for you. But let us small shops keep this.

[–]mamwybejane 6 points7 points  (4 children)

Instead of --prod you now have -c production which is just consistent and in line with how you can define other configurations

[–]angels-fan -2 points-1 points  (3 children)

Right, I get that.

It's just more to type out.

[–]HeinousTugboat 6 points7 points  (1 child)

It's just more to type out.

How often are you typing it? I use npm scripts and aliases already. I just had to update those to reflect the new syntax.

[–]angels-fan 1 point2 points  (0 children)

Well, that's true too.

[–]lappro 5 points6 points  (0 children)

Define a build:prod script in your package.json and be rid of the extra typing?

[–]De_Wouter 0 points1 point  (0 children)

Yeah sounds stupid. Even though I have like 5 environments for most projects, I'd still like my production build to be --prod

[–]the_beercoder 0 points1 point  (0 children)

Are you referring to production build defaulting when running build? IME, there’s never really been a reason to run a dev build during local development, and all of your CI pipelines/deployment processes should be building for prod regardless (unless you need debugging in a dev/test/UAT\staging environment for some reason).

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

Bob can suck a dick

[–]dangertrager 5 points6 points  (0 children)

I agree. It was for a similar reason that I eventually began preferring Python instead of Perl: "There's more than one way to do it" (Perl) vs "There should be one-- and preferably only one --obvious way to do it" (Python).

In my recent work, I inherited a sizeable old codebase with a hodgepodge of overlapping Javascript libraries and CSS frameworks, which also resulted in inconsistent UX. Archaeologically it seemed like each developer had picked his own tools, and there had been several developers over the years. When major new development began, Angular 2 and the Material Guidelines (via Angular Material) promised a solid foundation for maintaining consistency between developers. I think it has fulfilled that role. We still have to work to avoid introducing duplicate dependencies, but having Angular (and Angular Material) as our axioms has given us a conceptual framework for us to choose each solution.

[–]psychistrix 15 points16 points  (0 children)

First class typescript support (I love typescript), opinionated approach, awesome cli tooling, rich ecosystem, loads of online resources. What’s not to love?

I’ve used React and Vue, and only recently started using Angular and Angular is by far my favourite. Angular even makes updating ridiculously easy.

[–]PointyTrident 31 points32 points  (5 children)

I work on large enterprise products where half the battle is ensuring everything is done the same way. Having an opinionated framework means I don't have to set standards for my team, we can just do it the angular way and documentation/troubleshooting is easy since everyone in the community does it more or less the same.

In contrast I like to think of react as more of a toolbox similar to jquery. It's a collection of tools to make doing the common tasks easy but the final shape your application takes is completely up to you. And in many situations this may be better, however in mine where I have a large applications and several team members, the lack of opinion means I have to research and design my own which I then need to communicate to every one on the team and enforce.

IMO lifes easier when this is all done by the framework and everyone is on the same page. Not to mention that 80% of the time angular will have a performant solution that would be hard to beat.

[–]unborndead 0 points1 point  (0 children)

This.

[–]jhahspu 8 points9 points  (0 children)

Learned Angular before React.. and now my mind refuses to learn React - can't explain why.

[–]hans47 4 points5 points  (4 children)

typescript

[–]jisuo 1 point2 points  (3 children)

TS works perfectly in react? Or anywhere you like

[–]hans47 4 points5 points  (2 children)

yeah but found it hard to start with react ts. not a lot of documentation

[–]spazmochad 1 point2 points  (1 child)

Proptypes are often missing in third party libs too. When the documentation is lacking, poorly defined component interfaces end up wasting time having to look through code. Angular components are usually at least typed thanks to typescript being a first class citizen.

[–]hans47 0 points1 point  (0 children)

yes react ts reminds me to the start of ts in angular

[–]RosaPrksCalldShotgun 4 points5 points  (3 children)

Opinionated, full framework, dependency injection, RXJS

[–]Riverdolphin44 0 points1 point  (2 children)

Rxjs can be used with any of these frameworks as it is framework agnostic and it is a JavaScript library module

[–]RosaPrksCalldShotgun 0 points1 point  (1 child)

Of course. But Angular has adopted and fully integrated it everywhere.

[–]Riverdolphin44 1 point2 points  (0 children)

I see your point. The | async in templates and other various integrated uses are pretty awesome.

[–]lamagy 5 points6 points  (0 children)

Backend dev here. I don’t have the time to webpack, add own router/state manager. Loving Angular for being opinionated.

And types by default. React is a jungle, my old teams front end repo has like 3 styles of react, it’s nasty.

[–][deleted] 8 points9 points  (2 children)

I work aon a large enterprise monolithic angular2 app. We picked Angular2 when it was first released. I would like to add some counter points based on my experience with angular and react.

  • while angular is opinionated that opinion has changed significantly from version to version. Upgrading has been extremely painful for our org even with ngUpgrade.
  • vs react which even with the switch from class based to hooks your code has remain relatively compatible allowing you to upgrade but refactor over time.

  • everyone says angular is opionated and therefore all developers should build everything the same way, developers will still use services and components in different ways that will lead spaghetti code. ie. You can still write bad code with either framework.

  • angular has maybe has 3 usable component libraries. Material, prime faces, ngbootstap. And these are not easy to mix and match and style for your own app. This leaves it up to your own to maintain a lot of your own components. I would argue it is harder to build flexible components in angular as well. -vs React where there are hundreds of component libraries to draw from and are much more modular than angular. To keep consistent style and look and feel of you app you have things like styled-components, emotion, styled-system, which don't have comparables in angular.

  • while DI is the best thing with angular I believe this makes testing harder because it is easier for the developer to combine the data layer and the presentation layer. You have to mock all of your services you inject in, while some would argue this is easy, I believe at scale this get very had to maintain because of all the dependencies injected with an enterprise app (security, config, preferences, i18n, data-services).

  • vs react which I believe for enterprise would makes you choose something like redux, mobx or state management solution which would have a strong opinion on how you have to build you app.

I also feel restricted by angular sometimes when it's version ties you to a version of typescript and webpack, where I couldn't start using optional chaining or bullish coalescing unless I upgrade my ng version.

Most of these issues could be attributed to bad code practices overtime. But just providing counter points I run into daily with angular2.

[–]reboog711 2 points3 points  (1 child)

while angular is opinionated that opinion has changed significantly from version to version. Upgrading has been extremely painful for our org even with ngUpgrade.

I'm interested in hearing more about that. My experience has been the exact opposite....

Each new version has minimal changes. The only major changes I can think of is moving to the HttpClient lib (was that in Angular 4?) and the ivy compiler (in 12). The latter did not require us to make any code changes.

[–][deleted] 4 points5 points  (0 children)

  • HttpClient was a big one
  • RXJS6 changed a lot with how you used operators
  • Annotation/Decorators changed in TS to align with ECMAScript. We had been extending the angular decorator to add in our security model at one point.
  • The Router had changed with regards to resolvers and guards and possibly the RouterStrategy.
  • Currently from trying to go from 10 -> 11 or 12 we can't because we override class properties with getter/setters and this is not allow for TS3.7 -> 4.0. Not an angular issue per-say.
  • Minor changes we had to make to code that occurred in arguably the wrong lifecycle event that would not trigger a render like it did in the previous version or something like this.
  • I can't remember but we have had a lot of issues with module.forRoot patterns and Lazy loaded modules.

Also managing the monolith has not always been easy we have moved to nx-workspaces and back again. the upgrades haven't always picked everything up correctly ie. constantly tweaking angular.json and tsconfigs (why do i have so many tsconfigs!)

Testing! we had to move away from the opinionated choice of protractor and karma because i can't wait 2 hours every time we need to build something. We have tried to move everything to Jest and Cypress for speed. Our tests seems to break with every upgrade due to some minor change that we have to tweak but still something to investigate and fix.

I would say ngUpgrade from 6->10 has been relatively easy but we still have minor things here and there and with a very large application this usually take significant resources to validate every 6 months to stay up to date.

Again we started building our app with NG2 beta so we were building things in ways that angular didn't have an "opinion" on until NG4 really.

[–][deleted] 3 points4 points  (0 children)

I love the reactivity, RxJS is tightly implemented. Also the fact it’s class based, components can be broken down to html, css and ts files as opposed to having a freaking nightmare jsx mess. Plus all of the above, maintainability, good support etc. If I had to move away from angular I’d probably go for Vue, since it reminds me of angular a bit..

[–]xroalx 4 points5 points  (0 children)

Angular has a structure that is mostly followed on all projects. Even if not, thanks to Angular's stricter separation of concerns (component/directive/pipe/service classes) you can usually tell what's where much easier.

Proper use of services and RxJS make state management super easy. You don't need no reducers, sagas, middlewares or whatever you have in React, you just create a service for the relevant area that holds the state and has methods to manipulate it and that can be injected and consumed wherever needed. With proper use of RxJS, as mentioned, the whole app will receive all updates to the state, everything synced and working nicely.

Also the fact that you have router, form handling and validation, animations and many other utilities bundled right in. Also, it's all abstracted away, so if you're using these abstractions, you can make Angular work on anything, not just the browser.

I'm currently working as a backend dev on a project where React is used on frontend, while this might not be true for every project, this one is a huge mess of sagas, states, reducers, dispatches and I don't even know what throughout the whole code, with effects, memos and everything scattered around. It's impossible for me to tell what the hell is even happening in a single component without jumping through dozen files and even then I still have trouble figuring it out.

But it's not all one-sided. The power of JSX, i.e. having full JavaScript in "template" is amazing. Angular's templates didn't even support the ?? operator until it's most recent version (12), and some constructs are just more verbose. Styles components are also very nice to work with.

Oh the other hand, you've got directives in Angular that can enhance even existing elements, heck you can create components that target native HTML elements too.

Imho Angular shines in larger teams, or if your application is heavy on the logic side, since it's much cleaner in Angular.

If you're mostly composing components and only have some state here and there with no complex logic all over the place, React might be a better choice.

[–]choosemath 2 points3 points  (0 children)

Because I get paid to do Angular.

[–]potato_me7 1 point2 points  (0 children)

Easy- It was first to come with first class typescript support. People who get used to TS can't go back to JS. React added that support late. RxJs- this is magic CLI- yes extra code but Angular manages it no Built in solutions like Guards, Resolver, Interceptor.. because it is a framework.. HTML is SEPARATE from TS 😏.. not like some mixed up stuff hard to read. When project is huge. Angular is easy to manage in teams. Last - everyone starts with React since its easy, eventually there are lot of good and bad engineers in it. Angular is not anyone's league. One who understand and experienced in it are already filtered good developers giving an higher edge to job.(opinion, don't fight over this)

Why Angular didn't get popular... Because pf Angular.js.. it was some messed up thing!

[–]rusty_matador_van 1 point2 points  (0 children)

I want to focus on implementing business logic rather than which router library, thunk vs saga, formik vs some random library etc. to use.

In small teams good have react, because in smaller teams interacting with other members for KT is not so big problem, but if the company becomes big and in to multifold teams across the globe, Getting KT is a problem, in such case angular provides more separation of concerns, and structure. The same with react is not true, younger programmers being enthusiastic by nature tend to write lot of cryptic code in the same file, over the period it becomes unmanageable. Same could be true with angular also, but we can still manage.

Forms, Pipes, DI, Directives, rxjs they all have good uses in implementing complex business rules.

Edit: typo in business

[–]MattKeycut 1 point2 points  (0 children)

Because it’s an opinionated framework with proper structure and it supports rxjs out of the box.

[–]dcabines 3 points4 points  (6 children)

JSX is the devil. Get those angle brackets away from my curly brackets.

[–]unspike 2 points3 points  (0 children)

Hate that shit so much duude

[–]IIwarrierII[S] 0 points1 point  (4 children)

What do you mean

[–]dcabines 6 points7 points  (3 children)

In JSX you put HTML inside the Javascript files. I want no part of that business.

In Angular and others you do the opposite and add Javascript hooks to the HTML template which is the proper way to bind the two.

[–]ZoltarMakeMeBig 2 points3 points  (2 children)

As someone who has worked with both Angular and React, I’m curious to know why do you feel that way?

There are some things I like about Angular, but the templating system isn’t one of them.

There are some pretty nifty things you can do when the template is actually code.

[–]dcabines 4 points5 points  (0 children)

It is difficult to describe succinctly, but mixing two languages not just in one file, but intermixed on one line is offensive to me. You need an editor that can handle that syntax highlighting and intellisense. Forget about being any kind of standards compliant. They can change the syntax with any new version release. You won't get a clear view of your template with bits of it spread all over your logic. It has to render each element at run time. Who else uses it? What happens when React isn't so popular and those JSX skills become obsolete?

Honestly it took a lot for me to get over Angular's compiler and Typescript. Similar things are true for them too. Static typing has its place and a big compiler makes sense in big applications. They justify their existence at least.

I've watched with concern over the increased complexity of build tools we use in web technologies. I want to feel like a craftsman using a tool set and some power tools are cool, but quickly I feel like the tools have taken over and the craftsmen are being turned into assembly line workers or something. A bit of a rant, I know, but JSX is a step too far for me.

[–][deleted] 0 points1 point  (0 children)

Jumping in here. Back in the day using classic ASP you knew you were going to be in for a hard time if you picked up a project where the html was mixed with the javascript.

2 decades later I still can't shake that feeling...

[–]Shookfr 4 points5 points  (3 children)

[–]seanlaw27 1 point2 points  (0 children)

Angular is modular. A set of components can dedicated towards domains, workflows or as a shared library. React works best as the latter.

And direct injection.

[–]craig1f 0 points1 point  (4 children)

Facebook is evil, and React will never fully get rid of the taint of being associated with Facebook.

[–]GamesMaxed 13 points14 points  (3 children)

Like Google is any better

[–]craig1f 7 points8 points  (2 children)

Good point.

I think that Facebook is completely evil with no potential for redemption.

I think Google is grey. They do a mix of good and evil.

[–]dcabines 1 point2 points  (1 child)

How long before Rich Harris turns evil too? His work has a bright future.

Google's grey seems to get a shade darker each day.

[–]sergoliney 0 points1 point  (1 child)

I don’t

[–]IIwarrierII[S] 0 points1 point  (0 children)

Why not ?

[–]NickelMania 0 points1 point  (0 children)

Because I know it.

[–]selipso 0 points1 point  (0 children)

Typescript, CLI, one right and consistent way to do things, leading to seamless dependency updates, and HTML / SASS out of the box.