4 ms·
React and Angular are two very different experiences. Using Angular 2 with TypeScript is almost like using WPF and C# on the desktop - it has that enterprise f
by rubber_duck 11y ago
React and Angular are two very different experiences.
Using Angular 2 with TypeScript is almost like using WPF and C# on the desktop - it has that enterprise framework feeling - hierarchical DI everywhere, everything out of the box (DI, routing, events, forms, etc.), classes and OO are the foundation, decorators, even "functional" parts adopts RX from .NET. Using Dart gets you even more stuff working "out of the box" with a functional package manager and build system but it seems like that language might be a dead end so TS is a safer bet. Tooling provided powered by TS is top notch.
React is much more of a JS approach - sure the core library is smaller but in the end you throw in a bunch of libraries to compose your own framework and you're stuck with good old JS decision hell (should I use redux, which routing lib, etc.) - this may be an advantage if you you have a bunch of front end devs that like to sink time in to exploring the ecosystem and chasing the latest fads to keep up to date with what's being supported - but if you need a library to give to your corporate C#/Java devs angular would be my go-to. Coding styles are classic JS mix-and-match pseudo functional + pseudo OO.
Angular 2 feels slightly over-engineered but at the same time I'm more comfortable with this approach - even after using clojure full-time for 2 years - react feels too messy both from a functional/OO and ecosystem standpoint.
- spdy 11y agoReact is much more of a JS approach - sure the core library is smaller but in the end you throw in a bunch of libraries to compose your own framework Thats the reason i decided against React. After so many years of programming i really like opinionated its so time consuming to figure out which major library component (*flux) will be maintained down the road and have enough momentum behind it. And the combination of Angular2 with Typescript it really nice
- blowski 11y agoI have done some small personal projects with React, Angular 1 and 2 just for learning, and I agree with your assessment. If I were building a production system with a small team of intermediate non-specialists, I would use Angular every time. For a front end dev, it's like comparing SASS (React) to Bootstrap (Angular). They're both good at what they do, but they have different sweetspots in terms of the problems they're good at solving.
- kayoone 11y agoI agree, i also prefer an optionated Framework like NG2 in this case and i love Typescript. After 10 years as a webdev react and it's ecosystem feels like a step back to me in terms of maintainability of the whole thing if you have a really complex project. For smaller stuff, React is usually fine though.
- mercurial 11y agoNote that Typescript with React is totally possible.
- rubber_duck 11y agoThat's true but it's not what I was getting at - Angular 2 is developed in TS - it's designed with TS in mind - everything is built on classes, decorators. React is a mishmash of various approaches and tools - functional, OO, embeded markup, etc. You can get type definitions for it but it's not really "natural", for eg. support libraries just have terrible type definitions because they don't map to typescript type system nicely at all - which is what I was getting at.
- CCPony 10y agoWell, yes... and no. When I tried to use Typescript with React I couldn't help but feel like I was squeezing a square peg through a round hole. Eventually you can do it, but it's an effort. Ultimately you end up with something marginally better than plain JS. Since virtually ALL available React tutorials, courses, quick starts, etc are written in JS, there is very little support out there for TS. With Angular2, it's all TS all of the time. And, to me, that's incredibly important.