Hacker News new | ask | show | jobs
by rufugee 2573 days ago
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?
3 comments

<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.