Hacker News new | ask | show | jobs
by davedx 2575 days ago
As a long time React developer, I second this. Especially this part:

> There's no need to evaluate different routers, form libraries

These two things have been the bane of my React development experience ever since the days of "flux". Every new React project I start I end up using a different set of libraries, and it's not just me either -- a very experienced React dev I work with just switched our React e-commerce SPA's form library out.

Coming back to Angular after a long time (I used to work with AngularJS) has been like a breath of fresh air. The project I'm using it on is clean, simple, consistent. The code is readable, every form and component works the same way.

If I was building something with less consistent / regular UX then I would still definitely use React, but Angular has really pleasantly surprised me.

3 comments

This has really been the great thing about Angular. Our team has grown from 2 to 10 and our projects have greatly expanded. We have them all in a frontend/node layer monorepo where all our front end projects feel the same. Their organized in very similar ways, the 3rd party libraries are all on the same version and are used across the apps.

I routinely have to hop between all the apps and I don't have to think about which libraries someone has used for each part, if Angular has a version of something we need we just that. One of our bigger apps hasn't made the switch to ngrx, but that's about the only difference between the feel of them all.

Everyone's experience is different here, but I've grown to hate these all-encompassing frameworks -- somehow I always run into their limits. As far as I understand, Angular has its own module system, its own dependency injection, its own test framework. If you have any special requirements for any of those, you usually can't rely on the vast JavaScript ecosystem because Angular doesn't play well with many common JavaScript techniques. React also has a precompile step with JSX, but that's simple syntactic sugar, and besides that, React is really just a well-behaved library with a surprisingly small API surface. It doesn't try to do everything and it plays well with non-React libraries, at least in my limited experience. I usually find that in any context, taking such a mix-and-match approach is a lot more flexible in the long run than using a large framework.
Can you describe what limits you run into?
They work best if your team has low standards and just settle with whatever the framework has choosen for you. I'm not surprised it's fine for many.
I'm not sure I would consider uniformity "low" standards.

It's quite useful when there are multiple smallish projects, for example your typical web agency.

Also useful when you have one or two experienced programmers and a few less experienced ones: makes it easier to review the code.

That said for a highly custom application, especially one you're betting the company on, and need full control, a lower level approach can be beneficial.

Not limited to Angular vs Vue.js, the same applies to Django and Flask for example.

If you were new to React or Angular, but needing to choose one for a single developer project, which would it be now in 2019?
<li *ngFor="let item of list"> <-- this says it all, flow logic in your template is a debugging nightmare. There is no debugger for conditional statements that are declared in HTML.

TLDR - Choose React.

Angular is easier to get up and running. Then you also have a very solid foundation that can be picked up easily by new devs starting on the project. Whereas, React seems to work only for more experienced front-end developers since you have to make more choices. If someone is just starting out it can turn into a mess pretty quick.
I disagree. If you use create-react-app you get best practices out of the box.

React is also much less abstraction away from vanilla JS. Learning Angular is learning a new language with a whole bunch of restrictions. Learning React is like learning JS++.

(This is my personal experience based on three Angular projects and ten+ React projects.)

Yea? What about routing, forms, state, styles encapsulation, code separation to modules, http clients, etc. A lot of choices for new React project, zero choices for Angular === faster startup.
You don't need to choose the library but there's still the same amount of documentation to wade through, the amount of learning is the same.

although, code separation is native in React now and if you think http clients is still a thing you're too far into the Angular ecosystem to be helped.

Forms: use HTML5 and expand on that. State: quick read, I'd say use context, hooks and effects if you're new. Styles: I despise style in JS, so I go with SCSS or CSS. The encapsulation problem is made up in 90% of all apps. Http: just use fetch. If you'd like, you can write a vanilla wrapper around it. Code separation to modules - don't get what you're going at really. Build functional components. Keep shared logic in services, a POJO wrapping functions and exporting it all.
From my experience, learning React and picking an approach for each of the above is faster than learning Angular.
I mean you get best practices for the small part React is focused on. Angular is a full type of ecosystem, like your Ruby on Railses, Djangoes etc. in which you can install it and then create a full website directly without any dependencies other than what you get.
Comparing Angular to React is comparing apples to oranges. It would make more sense to compare Angular to React based frameworks such as NextJS [0]. Those are "easy to get up and running" and offer "a very solid foundation that can be picked up easily by new devs starting on the project", as well.

[0]: https://github.com/zeit/next.js/

Only if you know typescript and rxjs already is Angular easier to get up and running, react especially with create-react-app is trivial to get going.
Angular. Getting up and running is much simpler.