Live data from Hacker News

React vs. Angular 2

docs.google.com

71–80 of 87 posts

Re: React vs. Angular 2

#71
post #66

Earlier quoted context omitted.

If you ditch Babel you won't be able to use ES8/9.

For me ES6/7 has addressed all the low hanging fruit, I really hope ES8/9 is about removing features with only a few additions.

everybody agrees to add "only a few additions", except has different set of them!

Re: React vs. Angular 2

#72
post #66

Earlier quoted context omitted.

If you ditch Babel you won't be able to use ES8/9.

For me ES6/7 has addressed all the low hanging fruit, I really hope ES8/9 is about removing features with only a few additions.

Agreed... about the only thing from ES7 that I feel the burning need for is await/async, which I've been using for some time via Babel, and it makes the code so much easier to reason with... the hardest part is explaining to people that an async function returns a Promise and can be wrapped/used as such.

Re: React vs. Angular 2

#73
post #47

Earlier quoted context omitted.

Great comparisons. What's good resources to start learning react + redux?

I'd suggest starting with the React docs: https://facebook.github.io/react/docs/why-react.html And once you understand React you can dive straight into the Redux docs: http://redux.js.org/index.html I found it useful to actually read the Redux docs page-by-page (at least the introduction and basics) but it also links to some tutorials. I actually had to read the basics and advanced sections several times before it fu…

what will be the "best C" then? any recommendations?

Re: React vs. Angular 2

#74
post #22

Isn't this like comparing apples to a fruit salad? Quoting from the React website, "Lots of people use React as the V in MVC," whereas Angular is the whole kit `n' kaboodle. I thought React was supposed to be used in tandem with a Flux-like component that stores the state of the application, thereby allowing the developer to adopt the functional reactive programming style. Anyways, I think React will be short lived,…

From my experience, it is not about the FRP kool-aid. It's about the robustness of the concepts of React (DOM diff-ing, favor immutability, declarative views etc.) Adopting something like elm might have its advantages, but also comes with practical disadvantages that, depending on your team and your project might be simply too big make the jump. React got a lot of things right in my opinion. So much that to go from a…

I think a lot of attention is given tot he DOM diffing... I don't think it really means that much in practice as far as understanding the flux-like workflows and how applications come together.

To me, the unidirectional data flow, optionally immutable data structures and even tooling around redux (and similar) are what are nice. You have predictable, testable output without excessive complexity.

The need to understand a certain level of complexity in React+Redux in getting started is indeed a bit higher. But as features are added, that complexity doesn't grow nearly as much as with Angular.

I find the simpler node-like requires/es6-imports are easier to reason with than dealing with angular's weird DI system (though better in v2). Testing injection is supported via tooling (proxyquire and the like), and you can do full unit testing of your UI without firing up a browser.

I agree that full on FRP isn't needed... but will say that having data flowing in one direction, and events in the other can simplify things a lot. I'm also not sold on static typing for JS, as someone who really likes C#. I also think the use of classes in JS should generally be very limited.

Re: React vs. Angular 2

#75
post #19

Earlier quoted context omitted.

> Anyways, I think React will be short lived, because anyone who really wants to hop on the FRP bandwagon... I don't think most front end developers even care. React will stick around because it's backed by Facebook and if Facebook says this is the way to go with front-end development then that is all the convincing most folks need. They'll go on to learn React and not think twice about the minutiae of "FRP" or whate…

> React will stick around because it's backed by Facebook and if Facebook says this is the way to go with front-end development then that is all the convincing most folks need. Not just that. Facebook uses it for their flagship website (and as React Native for their mobile apps). So does Instagram. So does Netflix. If you have the React developer tools installed you can literally go to facebook.com or netflix.com and…

The new Grubhub UI is built around Angular... and it shows around the edges in the types of quirkiness and bugs that show up around state/workflow. I don't fault the devs ag grubhub for this, but the types of problems I typically see around Angular are pretty typical.

Personally, I really appreciate React+Redux... it seems to be the distillation of a lot of ideas. Also, good or bad, React has actually removed features in support of a better project/application workflow. That doesn't even get into how goofy I feel that Angular's DI system is (better in 2, but not good).

React has embraced the larger JS/npm community/tools and Angular seems to be actively fighting against it.

Re: React vs. Angular 2

#76
post #35

Two corrections: 1. You can use types with React, either via Flow or in TypeScript with TSX. Unlike with Angular, with React you can also get type checking even in the JSX template (checking for valid component property types included, even with TypeScript) 2. You can "externalise" your render method if you really want to by simply writing import MyComponentTemplate from './external-template.tsx' let MyComponent = Re…

React v0.14 adds "stateless functional components" syntax, which essentially makes your external-template.tsx a valid component on its own (with the caveat that no state or lifecycle methods are allowed): https://facebook.github.io/react/blog/2015/10/07/react-v0.14...

There seems to be progression into breaking apart components that have decision trees with components that are simply rendered... I've had a tendency to favor this myself.

Also, simple components can defer events to prop/parent binding.

Re: React vs. Angular 2

#77
post #47

Earlier quoted context omitted.

Great comparisons. What's good resources to start learning react + redux?

I'd suggest starting with the React docs: https://facebook.github.io/react/docs/why-react.html And once you understand React you can dive straight into the Redux docs: http://redux.js.org/index.html I found it useful to actually read the Redux docs page-by-page (at least the introduction and basics) but it also links to some tutorials. I actually had to read the basics and advanced sections several times before it fu…

[deleted]

Re: React vs. Angular 2

#78
post #73
post #47

Earlier quoted context omitted.

I'd suggest starting with the React docs: https://facebook.github.io/react/docs/why-react.html And once you understand React you can dive straight into the Redux docs: http://redux.js.org/index.html I found it useful to actually read the Redux docs page-by-page (at least the introduction and basics) but it also links to some tutorials. I actually had to read the basics and advanced sections several times before it fu…

what will be the "best C" then? any recommendations?

The C (Controller) is your own code, that controls your logic/needs.

Re: React vs. Angular 2

#79

What is this FRP thing JS developers talking about? What I should read to learn more about it?

If you ignore the whole thing about how frp is not FRP, and how javascript developers really only mean frp, then a good place to start would be learning about RxJS. FRP is deterministic and referentially transparent, frp is not. Key concepts in FRP are behaviors, events, signals; key concepts in frp is streams, observables, subscriptions. Although I'm not expert with either, there's a lot of overlap and term overload…

AFAICT, the simplest way of explaining the difference between FRP and "popular frp" is that in FRP things are described as functions of time, whereas in popular frp they are streams of events.

The "real" FRP is great for describing non-interactive things. They can be used to describe anumations: e.g. a FRP behavior can describe the position of a ball as a function of time:

  ballPosition :: t -> Position
whereas in "quasi" frp, the ballPosition is a stream of Position values:

  ballPosition :: (Stream Position)
Basically, quasi FRP is what you get when you sample real FRP at certain times :)

Re: React vs. Angular 2

#80
post #33

Earlier quoted context omitted.

The problem is that the surface of Angular is incredibly complex. With React, you have components, which are just things (classes or functions) that convert a set of properties to a subtree of more components (ideally mostly ones that directly represent DOM elements) and do so deterministically and reproducibly. With Redux you just have objects ("actions") representing changes to your application state and functions…

> Angular is a battleship. React+Redux is an attack submarine. > The value of the battleship has been questioned, even during the period of their prominence.... battleships were increasingly vulnerable to much smaller, cheaper weapons...[11] https://en.wikipedia.org/wiki/Battleship I'm not sure if your metaphor was intentional, that Angular is like a flashy, seemingly powerful but ultimately archaic, dead-on-arrival…

> I'm not sure if your metaphor was intentional

I'm not denying it was...

Post reply on HN