r/javascript • • Sep 15 '16

Angular 2 Final Released

http://angularjs.blogspot.com/2016/09/angular2-final.html
358 Upvotes

190 comments sorted by

View all comments

31

u/mdboop Sep 15 '16 edited Sep 15 '16

And nobody cares. I doubt adoption rates will be significant, but who knows, I guess. It just seems like there are so many things going against it that will outweigh its merits. Embracing rxjs, awesome. Typescript, fantastic if you're into it. But people are sick of Angular 1.x for the most part, Angular2 took forever to be released (feels like the opportunity went stale a while ago), and it's still pretty damn complicated compared to React or Vue.

People talk about how JS frameworks change all the time and say React will likely not be around forever (I hear this from co-workers when I bring up why we should switch from Angular 1.x to React), but someone on my team brought up an excellent point: React is used to build FB's flagship product. It's literally everywhere in the site. But Angular? Nowhere to be seen in any Google product of note. To me, that speaks volumes (on top of it's other merits).

edit: and, of course, React will not be around forever. But I'd put my money on it over Angular2 any day. edit2: forgot a word

21

u/Shaper_pmp Sep 15 '16 edited Sep 15 '16

You also left out the most important point - Angular is a framework, and with any framework almost everything is done "their way or the highway" (or at least, their way or you're off in the weeds of unsupported/second-class-citizen workflows with limited support and documentation).

React is a library, and - like any other library - if necessary you can swap it in and out for alternatives without completely reengineering your entire application.

Frameworks are convenient but fundamentally limiting because they dictate the structure of your application, so you're always trying to express both the problem and the solution in terms of one specific tool. With a full toolbox you can hammer nails, screw in screws and spread glue as appropriate. With exactly one tool in your toolbox you either severely limit the kinds of projects you can undertake or you inevitably end up banging in screws sooner or later because that's all you can do.

Composing libraries together takes more effort, but gives you more flexibility, allows you to avoid lockin more easily, and allows you to express your solution in terms of the problem-space instead of coercing you into a "one size fits all" approach that never really quite does.

8

u/rk06 Sep 15 '16

In those cases, one can chose aurelia.

2

u/Channel6 Sep 15 '16

Shame this comment will be lost in the usual flood of react vs Ng, there really is an alternative...

0

u/[deleted] Sep 15 '16

[deleted]

→ More replies (1)

18

u/pegbiter Sep 15 '16

React is beautiful.. in principle, but to actually do useful things with it you need so many additional libraries that the slickness is lost. You want ajax? You need an additional library. You want promises? You need an additional library. You want routing? You need an additional library. And god forbid something goes wrong and you have to trace through the documentation of each of these libraries and how they work with react proper.

In theory, sure I could pull out react and replace it with some other view engine, but in reality I'd be pulling out react and all the other react-based libraries and replacing/adjusting all of those.

Angular 1.x sure isn't perfect, but at least all the most basic tools you need for a web application are right there and I never have to worry about how $http works with $scope or whether $q is a compatible version.

8

u/theonlylawislove Sep 15 '16

in principle, but to actually do useful things with it you need so many additional

This is actually a benefit. You are looking for an opinionated Swiss army knife. With React, you do things what makes sense to you, not what the framework forces you to do.

6

u/g0liadkin Sep 15 '16 edited Sep 15 '16

Please define what you mean with "forces".

Angular does not recommend many vanilla js aspects, but does not "force" you not to apply them, it's still javascript and you're able to do whatever you want to do within the language's bounds, even if that means (for example) accessing and handling DOM inside a controller.

3

u/fenduru Sep 15 '16

This is actually a benefit. You are looking for an opinionated Swiss army knife. With React, you do things what makes sense to you, not what the framework forces you to do.

In Angular 2 most features are implemented deep in the compiler. For instance, I wanted to compose their @Input decorator to create an @ObservableInput decorator that would create a stream for me, but you can't because their decorators just add metadata that is specifically for the internals of the compiler. Not extensible, so good luck if you hit a point where they haven't thought of your use case.

3

u/theonlylawislove Sep 15 '16

Let's just say it's an opinionated ecosystem.

→ More replies (2)

5

u/pegbiter Sep 15 '16

I don't really see how it's a benefit, because React on its own is utterly useless to me. Sure, if I want to quickly mock up the standard 'to do list' test app and just demonstrate data-binding, yeah that's great. But I've worked on dozens of web apps, some tiny and some huge, and every single one has needed ajax, promises and routing, to some degree. Those aren't optional 'nice to haves', they're absolutely core tools.

React forces me to rely on a load of other libraries just for core functionality.

If you like that, then Angular comes with those benefits too. Sure, Angular has a router, but there are other Angular routers you can use too. Sure, Angular can do datetime formatting, but there are other directives (moment.js is absolutely brilliant) that extend that.

0

u/[deleted] Sep 15 '16

[deleted]

5

u/pegbiter Sep 15 '16

I just think comparing React to Angular isn't really a fair comparison. We should really be comparing React + Redux + Flux + React-Promise + React-Router to Angular, that's the actual real-world use-case. And at this point, I don't really see the benefit because I'm relying on all these libraries to do really basic things, and all those libraries rely on react, so I'm as tied down to React as I would be with Angular.

8

u/[deleted] Sep 15 '16

Why would you be using Flux with Redux? Why would you be using React-Promise in a toolchain that already transpiles JSX and can therefore shim ES6 and its promise objects? It's a disingenuous example and it weakens your argument.

→ More replies (3)

2

u/TinyZoro Sep 15 '16

I don't really get this. We are talking about crud applications on the internet for the most part. What are the situations where an opinionated framework gets in the way?

→ More replies (1)
→ More replies (7)
→ More replies (2)

12

u/pegbiter Sep 15 '16

I don't agree that 'Facebook uses React' is necessarily a ringing endorsement of React, or a useful argument for what to use when starting a new project. We have no real idea about Facebook's technical or business requirements, what sort of legacy code they need to support, or what decisions they'd make if they were rebuilding from scratch.

The reality is that you can make exceptional web applications with either Angular 1.x or React (+ a load of gubbins), and the limiting factor is probably going to be the skillset of the developers rather than the library itself.

40

u/brianvaughn Sep 15 '16

Google uses Angular too fwiw. I used to work on Google Cloud Platform and we used Angular exclusively for the GCP site. My wife works on Google's CRM and they use Angular 2 for it. (It's the biggest Angular app anywhere and it's what Google manages all of its revenue through.)

I'm using React these days and enjoying it so this isn't a fanboy response. Just sharing some info. 😊

5

u/[deleted] Sep 15 '16 edited Sep 15 '16

Google uses Angular too fwiw.

They do. But it is important to be mindful that Google's priorities may not be the same as yours.

Google wants to make front end development accessible to its army of Java developers. That's what they hire and that's what they invest in. It's why they wrote GWT for compiling Java into JavaScript and why TypeScript appeals to their sensibilities.

To that end, Google's interest in NG2 is in whether it allows their Greentea team to successfully ship Adwords. That is the only criterion that guides their design - and that's why Rob Eisenberg of Aurelia left the project: Google just wasn't interested in catering to anyone's usecases beyond their own.

By all means, jump on Angular if you think your needs are the same as Google's. Possibly they are! TypeScript will make client code friendly to developers suspicious of dynamically typed, interpreted languages. Angular's ceremony will appeal to software architects whose work is guided by a zeal for explication at the cost of verbosity. None of these are illegitimate motivations.

But are they yours? For most teams building new projects, probably not. Their concern is to get something built quickly and cheaply. They need to use technologies that make prototyping fast and let them hire from the largest possible pool of developers. Angular 2 is not that, and I expect it never will be.

→ More replies (3)

15

u/Conradfr Sep 15 '16

I care.

I liked Angular 1, the time invested in learning it benefited me greatly professionally-wise.

React can be fun but each time I want to setup a new project any tutorial from last week is obsolete.

If Angular 2 helps me getting up quickly without having to know which hot module reloader or router is the flavor of the month I may try it.

Also, I know companies that already use it in production with alpha versions.

→ More replies (3)

4

u/rbnc Sep 15 '16

TypeScript

I kind of hate how they force TypeScript on you when learning Angular 2 there are no JS docs only TS.

I'm sure TS is great and everything and I am glad to be learning it but the steep learning curve of Angular 2 PLUS TypeScript makes for some slow learning. It took me three days to really get to a point where I could creating my project.

10

u/Zipstacrack Sep 15 '16

Well I mean, lots of people care. My entire organisation has been developing all our new clients in Angular 2 for a while now so this is a big deal for us. Many of my friends are developing their own projects in NG2 and a place I interviewed at a few weeks ago is going full Angular 2. This is backed by Google, which a lot of organisations (especially larger ones) care greatly about.

I'm thinking the adoption rate will be quite high considering how organisations I know that are running the RC in production ¯_(ツ)_/¯

2

u/rosswarren Sep 15 '16

Google's support doesn't mean all that much. Google are happy to drop things that are no longer in their interest to support. See GWT for example.

→ More replies (1)

4

u/PiercingPancake Sep 15 '16

Google uses Angular 2. For example in Google Fonts

They even use it with Dart language. https://www.dartlang.org/community/who-uses-dart

2

u/Mael5trom Sep 15 '16

Angular is used for Google's largest app, AdWords, along with over a thousand other apps, internal and external.

2

u/fenduru Sep 15 '16

FYI they haven't embraced rxjs except for using it in the HTTP module. Their components have almost no support for observables. The only thing available is a pipe so you can write someObservable | async in a template and it will subscribe for you. But getting a stream of events from your template is all boilerplate. Getting a stream from your pops is all boilerplate.

→ More replies (9)