4 ms·
I am in no way the whole crowd, but having used both legacy AngularJS, React, and Angular 4+ in production for medium-sized apps, this is my main takeaway: The
by kroltan 7y ago
I am in no way the whole crowd, but having used both legacy AngularJS, React, and Angular 4+ in production for medium-sized apps, this is my main takeaway:
The mental model for React is much simpler than Angular's.
In React, There are two concepts one needs to understand: Components, and Hooks. JSX too, but as a web dev the HTML-like syntax was already familiar.
In Angular, you need to understand: the binding syntax; Components; Templates; Factories; Modules and Services. And learning bindings also means learning RxJS (which I love as a standalone lib, but is a big cognitive load when coupled with the rest of ng).
Even just comparing the "Fundamentals" page of Angular versus the "Main Concepts" of React (which, isn't exactly the best measure of complexity, of course, but it's A measure), you can see Angular spends 8 of its 10 sub-sections explaining essentially-required concepts, while in React it uses 6 out of 12 sub-sections.
React is much more concise in terms of concepts, and instead just has a bunch of common patterns that are sufficiently approachable and memorable, but most importantly can be "rediscovered"/"derived" on your own, rather than relying on framework-provided "black box" concepts.
- brailsafe 7y agoI think that's pretty well correct, but my preference has been the opposite in terms of more concepts vs cognitive complexity. I find that to do the same stuff with react and redux and so on, you end up decoupling and abstracting in such a way that the 5 or concepts in something like Angular or Vue end up being a more manageable mental model. In the sense that the main purpose of React is lost in the weeds of trying to managing the modularity of your app.
- kroltan 7y agoI have found good success with React + RxJS, in fact. They have some overlap, but with the benefit of interop outside React, and Rx is excellent at both message-passing-style events, as well as general-purpose "data binding". And the total load is still in my perspective smaller than Angular. I have never even casually used Vue (I've since switched to gamedev as a profession), so I cannot comment on it, but from a cursory on its docs, it seems like a leaner Angular, which is good.
- brailsafe 7y agoThat's a curious suggestion. I've never taken a serious look at RxJs, but I've used obsevables in android so might do that. Vue is like React but just enough separation to get all the benefits that I find in composition as well as the templating and stuff from Angular. How did you make the switch to game dev?
- kroltan 7y ago> How did you make the switch to game dev? I've always had gamedev as a goal, and since 2012 participated in "game jams", which are basically make-a-game hackathons; as well as making free web games/prototypes. The industry is very portfolio-focused. Mostly did webdev as a way of supporting myself until I got a gamedev job (but I like doing webdev too). I currently work at a company that makes corporate/educational games, but am collecting more experience to be more competitive on the actual entertainment industry. Which is a bit more challenging given I'm based in Brazil. That being said, it's much easier to "switch careers" when you're 22 and it barely started!
- IggleSniggle 7y agoMy favorite things about Angular were it's choice to use TypeScript, RxJS for state, CSS-in-JS-like, and Dependency Injection. I'm glad I learned Angular to be exposed to all those choices. My favorite things about React were JSX and FP. Seems like you've found a good way to have it all.
- ggregoire 7y agoYou don't need to understand hooks to use react.
- kroltan 7y agoYou have a looser definition of "to use" than me. Let's agree to disagree.
- a_wild_dandan 7y agoIf your definition of usage excludes the hordes of feature-rich production React codebases with no hooks (hooks being a relatively recent React addition), I'd call that definition...counter intuitive.
- mgechev 7y agoThis is true for Angular as well. To use the framework you don't need to understand everything it provides. In https://angular.io/start https://angular.io/start we're aiming to reduce the initial conceptual overhead. We understand that we can work on simplifying the mental model of Angular. This is something we're working towards. We're careful with in process though because we want to provide a consistent, backwards compatible development experience.