When writing React code I'm always accidentally fighting to make things more complicated than the system wants, naively opting for the former version, and only after some refactoring settle on the latter, simpler (but more numerous) representation.
When writing Angular code I'm always fighting to make things simpler than the system wants, trying to break my code up into more distinct components, and only after refactoring or hitting my head against the wall settle on the more complicated (but fewer in number) representation.
That is, I think, why the comparison between the two is valuable: not because they are libraries that fill the same niche, but because they encourage distinct development styles.
Re:Angular vs. React – the tie breaker
by Guillaume86 on Thursday July 09, 2015 @12:07PM
(#9858739)
I think the major achievement of React is the API design: minimal, easy to grasp, composable and make it hard to do stupid things (overly complicated code).
I started out in React by putting all my actual render functions in separate files and linking them to the component in a similar way to this templating setup. It's a pretty natural reaction everyone has when first using JSX... but silly as it sounds, the annoyance of having long render functions in your components actually encourages you to split them up and end up with better code.
That said I never got over wanting nicer if/looping in JSX - if anyone else wants that compromise you can use the library I made to do it: https://github.com/valtech-au/jsx-control-statements.
Why do people keep comparing Angular, a complete framework with React, which tackles only a subset of Angular? Also, the supposed architectural "benefit" of using React over Angular is absolute bullshit. You can have the same exact approach using Angular — the one with 50 different components — by building 50 different Angular Directives. I absolutely abhor when people make absolute statements about things to which they are completely ignorant about.
Re:Angular vs. React – the tie breaker
by bryanlarsen on Thursday July 09, 2015 @10:59AM
(#9858194)
You could split into that many components, but I've never seen anybody do so. Why not? Is it cultural?
One of the nicest things about designing a React app is that React makes it so easy to divide your app up into tiny little components that compose and reuse well, and are really easy to understand. Where an angular app might have 5 different controllers and accompanying templates, a similar React app might have 50 different components.
One of the reasons that it's so easy to split off a new React component is because JSX is inline. Putting that into a separate file increases the impedance and maintenance burden substantially.
In other words your
Is much more likely to be: who wins now?