r/programming • • Sep 15 '16

Angular 2.0.0 officially released

https://www.npmjs.com/~angular
1.3k Upvotes

535 comments sorted by

View all comments

Show parent comments

187

u/8483 Sep 15 '16

I started learning Angular 1, and then Angular 2.

As I went further, it got more "magic" for me, meaning there was a lot of code sugar that works behind the scene. I had to learn Angular specifically, not Javascript per se.

I decided to try out React, and my god has it made me a better programmer. Instead of learning very specific Angular syntax, I actually started to learn about programming patterns.

Injecting HTML into JS for React turned out MUCH better than the other way around for Angular.

The downside to React is the fact that there is no official way for handling data. Angular has this out of the box, whereas in React you'd have to do a ton of reading and trying things out. However, this is exactly why I chose React, as it forced me to learn more JS rather than more Angular.

I suggest you try it out and see what you like more.

0

u/[deleted] Sep 15 '16

[deleted]

44

u/8483 Sep 15 '16

Probably because React is a rendering library, whereas Angular is a application framework.

Yes, you are correct, they aren't very comparable. Again, I like the fact that I am learning more JS and patterns rather than more Angular. Now I am getting into Redux for React, after reading about Flux, Reflux, MobX, Relay... Exactly what you said about the flexibility.

It is indeed a matter of taste. I really liked the opinionated approach of Angular. However, the more Angular I learned, the more special syntax I encountered, which eventually turned me off.

Again, Angular is awesome for what it does. I just chose to focus more on learning Javascript and reduce the magic to a minimum.

32

u/MisfitMagic Sep 15 '16

I agree with you 100% on the syntax. Every time I read the docs, I can't help but keep thinking this is all some elaborate troll, and that they're just making shit up as they go.

25

u/clothes_are_optional Sep 15 '16

and that they're just making shit up as they go.

thats just software in general

8

u/elr0nd_hubbard Sep 15 '16

But mine has tests.

...sometimes.

2

u/iopq Sep 16 '16

Mine has tests that need to be updated every time you update the software. Add a new command? Sorry, the list_commands test is now failing.

→ More replies (3)
→ More replies (1)

7

u/STEVEOO6 Sep 15 '16

I was in a similar position recently. Came off Angular 1.x to give React (+ Redux + Saga) a try. I'm so glad I did. I've found having less 'magic' has made me understand exactly what is happening in my program at all times... Usually now if something breaks, I know exactly what happened without any debugging. Everything is just more predictable

→ More replies (3)

0

u/[deleted] Sep 15 '16

[deleted]

→ More replies (5)
→ More replies (4)

2

u/cadekat Sep 15 '16

I am all for both approaches. I think if you can find a framework that suits your style, requirements, and such, you'll have a wonderful time. For me, Django fits perfectly.

Oftentimes you won't find a framework that does what you need in a way you like, so you can build something from various libraries, and hook them all together.

17

u/yogthos Sep 15 '16

As I went further, it got more "magic" for me, meaning there was a lot of code sugar that works behind the scene. I had to learn Angular specifically, not Javascript per se.

I think this is an extremely important point. I'd rather be learning general patterns and core concepts instead of learning a framework.

A lot of the complexity in frameworks isn't inherent to the problem they solve, it's an artifact of how it was designed and the thought process of the people who made it. You're basically learning to think about the problem the way the authors did.

In many cases though, the authors didn't really know what they were doing either, and once the framework gets into wide use a lot of problems become evident. To address these problems the framework often needs to have some serious rework done on it. So, frameworks change very quickly as seen with Angular 1 and 2. A lot of the effort you spend learning a framework ends up being of only intermittent value in the end.

3

u/8483 Sep 15 '16

Exactly. I am not bashing Angular at all. It's just that I learn more with less hand holding.

1

u/Xevantus Sep 15 '16

I keep hearing this, but I had to learn way more react/redux/JSX specific ways of doing things for React than I ever had to learn for either angular 1 or 2. I find it's more of a subjective thing than an absolute. I usually see it come down to if you were already familiar with the patterns of one or the other, that one will be easier, and the other will be unnatural. I.e. ASP.net -> angular, process routing -> react.

→ More replies (5)
→ More replies (1)

11

u/paul_h Sep 15 '16

Injecting HTML into JS for React turned out MUCH better than the other way around for Angular.

Nice quote

1

u/8483 Sep 15 '16

Indeed. It's from this article.

26

u/myringotomy Sep 15 '16

However, this is exactly why I chose React, as it forced me to learn more JS rather than more Angular.

For a lot of people this is the reason to choose Angular over React.

11

u/LuckyHedgehog Sep 15 '16

As a back end developer who could care less about learning front end, angular + bootstrap templates is perfect for me

4

u/[deleted] Sep 15 '16

Yeah, it's almost as if angular was made for Java developers... ;)

→ More replies (1)
→ More replies (3)

1

u/8483 Sep 15 '16

That is why I chose it too. But as time went on, I was more interested in learning what really goes on in the code.

5

u/Retsam19 Sep 15 '16

The downside to React is the fact that there is no official way for handling data.

Personally, I count that as an upside: it doesn't force you to fit it's One True Data Handling Pattern, (which makes it easier to work it into existing projects, for one).

If you do want some structured data handling designed for React, take a look at Flux or Redux. (I haven't used Flux, but I've really been impressed with Redux so far)

2

u/8483 Sep 15 '16

I too look at it as an upside. I meant downside because of having to learn more. :)

3

u/sordnax Sep 15 '16

Is there any reason to still learn Angular1? I'm just wondering about job prospects.

→ More replies (1)

1

u/[deleted] Sep 15 '16

I took the same path, but I didn't care for React. The entire JS landscape is so polluted with libraries and frameworks it's become an incredible mess, and React is highly symptomatic of this problem. Every time I'd go to find how to do something I would find fifty different ways of doing it and end up down a rabbit hole of libraries so deep that I would forget what I started out to do. I like that Angular is highly opinionated about how to do things. I don't have to guess at which of the dozens of versions of flux is the right one, it's all baked into Angular and I can choose to replace something if I really need to. I did prefer the JSX approach over Angulars nebulous syntax, but not enough to feel really passionate about it. Also, we use visual studio where I work and the support for Angular and type script was (is?) vastly better than support for React and JSX. That in and of itself was enough to make me stick with Angular.

→ More replies (1)

1

u/SmaugTheGreat Sep 17 '16

I tried going for react, but it having no equivalent to Attribute Directives made me switch back to Angular.

→ More replies (4)