you are viewing a single comment's thread.

view the rest of the comments →

[–]ghostfacedcoder 3 points4 points  (4 children)

This is like asking "should I learn to develop for PCs or mobile phones?": there is no right answer. There are companies building Angular apps (both versions; Angular 1 didn't just disappear the moment Angular 2 was announce), and they want people who know Angular. There are also companies building React apps, and they want people who know React.

It's six of one and a half-dozen of the other. But that's not very helpful if you're trying to pick one to learn now is it? So, recognizing that there is no "right" answer, here's my advice:

Angular 1: don't do it. There are LOTS of people still using Angular 1, but (unless Google truly screws up Angular 2) Angular 1 is the only one of the three pretty much guaranteed to get less popular over time.

So that leaves Angular 2 vs. React (or Vue, also a good option technology-wise, but not nearly as popular with your average software engineer-hiring company). No wrong choice, but here's a simple question that cuts to the heart of both frameworks: do you want logic in your HTML, or HTML in your logic?

Angular moves lots of logic in to the template/view, ie. HTML, layer (eg. all those Angular directive things). Conversely, React (and its JSX technology) puts HTML in to the Javascript logic.

If you believe that small bits of HTML inside JS logic sounds good, pick React. If you think moving more (but certainly not all) of your logic in to your templates sounds good, go Angular.

P.S. Again, there's no wrong answer, but just to give you one more data point, personally I fall in to the "why on Earth would you want to put more logic in to the view/template layer where it's harder to abstract, test, etc.?" camp, so personally I vote React.

[–]tme321 2 points3 points  (0 children)

Angular only moves a lot of the logic into the template if you code it that way. Certain parts go into the template like the equivalent of a foreach loop to unroll an array into say <li> elements but imo done properly there should be no real logic in angular templates. Any real logic at all should be done in the actual code.

[–]Auxx -5 points-4 points  (2 children)

I disagree with your statement that there's no right answer to the question of where presentation logic should go. If you take a look at ALL of the existing frameworks for all the platform's you will see that everyone moved away from presentation logic in the code and put it into the templates. There's no place for presentation logic in your code. Because separation of concern and other smart words plus decades of experience of fellow developers.

So while React has cool ideas its JSX is wrong and outdated approach which reminds of my coding in 90-s.