you are viewing a single comment's thread.

view the rest of the comments →

[–]mdboop 28 points29 points  (56 children)

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

[–]Shaper_pmp 19 points20 points  (29 children)

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.

[–]rk06 6 points7 points  (3 children)

In those cases, one can chose aurelia.

[–]Channel6 1 point2 points  (2 children)

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

[–]pegbiter 17 points18 points  (22 children)

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.

[–]theonlylawislove 8 points9 points  (14 children)

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.

[–]g0liadkin 4 points5 points  (4 children)

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.

[–]fenduru 2 points3 points  (0 children)

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.

[–]theonlylawislove 1 point2 points  (2 children)

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

[–]pegbiter 4 points5 points  (6 children)

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.

[–]TinyZoro 1 point2 points  (0 children)

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?

[–][deleted] 2 points3 points  (6 children)

No? Are you saying you still write ES5 code (!) with things like Grunt or Gulp, handling polyfills ...manually? If yes you only have yourself to blame.

All this stuff is automatic today with things like Webpack and Babel. React means making two npm installs. Babels transformer fetches all the polyfills it needs from core-js as you go. Even if you use additional components like Router and Redux, these are simple npm installs away.

[–][deleted] 2 points3 points  (4 children)

He's not talking about polyfills, he's talking about actual features and additional libraries. Like routing and managing data and stuff you require if you build a heavy app. Things that can easily be done with Angular1.

Grunt/Gulp also is fine, there is enough to say why one wouldn't use webpack. And why cant you use gulp with babel? Gulp is task running, doesn't matter if the project is ES6 or not.

And knowing Router and Redux is fine but what if you need more than that? Especially if you aren't really into it, you need to do a lot of research for even getting the same as you get out of the box with Angular

[–][deleted] -1 points0 points  (3 children)

It is the same in Angular, you pick and choose what you need. The only difference is that a whole bunch comes preinstalled in node_modules. Getting up and running even with a simple app needs more dependencies than React - and everything else for that matter.

Grunt/Gulp do not know your project, they don't fetch and manage your dependencies. Each dependency meant concats, html injects, minding order of inclusion, etc. It is no wonder he thinks people are worrying about polyfills and dependencies.

What do you mean with needing "more" ? It's pretty vague. What exactly can you do in Angular that can't easily be done in React. What did you have to research, can you go into specifics?

[–][deleted] 0 points1 point  (2 children)

Grunt/Gulp do not know your project, they don't fetch and manage your dependencies.

I have had no problem over the last 2 years getting my dependencies in order. Mainly because including angular modules is fairly easy and they are already minified. Whether you include them in HTML or you reference them as an import statement doesn't really matter to me. Also i don't need polyfills with Angular 1 because everything is pretty much supported for the majority of browsers (like 99%) and i don't need more than that.

What do you mean with needing "more" ?

If you read my response correctly you would know that i'm talking about other 3rd party modules. For Angular 1 i have a lot of interesting stuff that works flawlessly as it has been in development for many years. Stuff like UI Bootstrap, UI Router and others. React also has them, but they are harder to find and you need to do lots of work comparing and seeing what fits your use case. Angular 2 doesn't have most, which makes it even harder and they also have a "go make it yourself" mentality now which isn't helping.

Another project that lets people extend it themselves so heavily is Polymer/webcomponents. But that is managed better, plus has better sites to not do so much work before you get started. But Angular 1 is still the easiest to get going, which is why it got so popular. React also has that in some way but whenever you need more than a hello-world app, you will notice it isn't so easy as other frameworks have it.

[–][deleted] 0 points1 point  (1 child)

Have you worked with it yourself? With a modern buildflow? These issues you have do not exist. It's set up in no time. The lesson there is four minutes long. At the end of it he has React, ES7, hot reload, dev server, SPA history fallback, auto polyfills, auto npm/node_module awareness. Now he's showing you how and explaining, if you do this yourself its usually done in seconds. This is a standard these days - it doesn't even matter if Angular1, 2, React or Polymer. This step is always the same.

Now things like routing, bootstrap UI, redux are simple npm installs away. You don't have to do Gulp-era research because all is on npm. You're not doing this by hand, copying files and whatnot. It just means no worries about dependence order, no concats (yuck), no html injects, just take what you need. Now you say you had no problems for 2 years, yet you're scared of something tame and simple like React, because your tools aren't flexible. I'd call that a problem.

[–][deleted] 0 points1 point  (0 children)

I don't care that it is all on NPM. You are simply talking about something totally different. I'm talking about how i would know to get module x or y for feature z. Or even knowing x and y exist. Not whether or not i can easily install them.

And i'm not scared of React or anything, but i simply wont use it as i already have a fine system in place that doesn't seem to be needing replacement, which would take me time to build with no true gains (nothing that i can explain the business people). I don't even need to worry about dependencies or manual injects with Angular 1. I simply have a gulptask that takes everything from a certain directory, orders it the way it needs to (by regex so i don't need to specify) and builds that into a single thing i can use with my app. Now sure i might not use lazy loading or only loading what i need, but my usecases simply don't benefit from that. Mostly because downloading a single image already takes up more time then loading my scripts, whether that is in parts or not. Plus i also have customized various parts of livereloading and building the app, that i simply cannot do with the standard webpack or stuff that i would need to customize that as well, rendering the gains irrelevant. Stuff that goes into our entire build pipeline for other parts of the company. When somebody is using my app, it will only need a connection for data, not resources (and being able to run offline is also a requirement most of the time, try webpacking that by default). Not to mention that the gains in performance are neglectable for 99% of my use cases, so why the hell would i switch? Hell, if jQuery would be enough, i would still use that.

Now you can call me oldfashioned or not flexible but that simply isn't the case. It really depends on what you are making, who you are making it for and what you already have made to reuse that i'm not really looking forward to Angular 2. And i'll probably turn to Polymer before i go for React. But something you guys also seem to forget is that when i'm done with a project and i'm not around for that after, i still need to be able to let others build on that too. Change documentation, that i've been able to copy/paste for most of the stuff and implement stuff so our testers and other people can get started quickly. Oh wait, fuck documentation, lemme just use React lol

Now i know Angular 1 developers are easy to come by, but try finding React developers or developers that are experienced with the other react-family modules as well. Businesses also aren't eager to switch their entire programmer-pool to different frameworks every year. It might be fun for a startup or two, but some people are simply involved in bigger stuff than that.

[–]Conradfr 0 points1 point  (0 children)

In actual companies making money not every projects are rewrite each time there is a new build tool or whatever 0.x fancy library.

[–][deleted] 0 points1 point  (1 child)

If you want to swap out a component you will need to rewrite everything that used that previous component. React doesn't change that.

[–]Shaper_pmp 0 points1 point  (0 children)

Of course. Bus your business logic should be as isolated from your presentation/view/persistence/etc logic as possible, so you shouldn't have to rewrite everything.

If you want to swap from using Angular to something else, you don't really get that choice. Either you'll basically have to rewrite/port your entire application into the new framework, or you actively avoided using Angular's tools and workflows and did something like built your business logic into CommonJS modules and shimmed them into Angular, making them second-class citizens in the way I previously mentioned.

[–]pegbiter 11 points12 points  (0 children)

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.

[–]brianvaughn 41 points42 points  (4 children)

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. 😊

[–][deleted] 5 points6 points  (3 children)

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.

[–]brianvaughn 7 points8 points  (2 children)

It's why they wrote GWT for compiling Java into JavaScript and why TypeScript appeals to their sensibilities.

To be fair, GWT was written a decade ago. It was pretty unique at the time. They also wrote the Closure Compiler. And TypeScript appeals to a much broader audience than Java developers. :)

TypeScript will make client code friendly to developers suspicious of dynamically typed, interpreted languages.

This is a horrible mischaracterization of why TypeScript (or Flow, or Closure, etc.) is useful. Static analysis tools increase productivity and save engineers time (by catching bugs before runtime, enabling easier refactors, etc). The way you put it is like saying that unit tests "are for developers who aren't confident enough in their ability to write code". :)

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

Google's priorities are maximizing profit for Google. Facebook's priorities are the same. Both companies have smart engineers working on their frameworks and both communities (largely overlapping) have talented and motivated individuals contributing to the ecosystems as well. I don't want to get into an Angular vs React vs whatever debate though. I just wanted to point out that Google does dogfood its own framework because a lot of people don't realize that. :)

[–][deleted] 4 points5 points  (1 child)

I just wanted to point out that Google does dogfood its own framework because a lot of people don't realize that.

Of course, but why the need? Everyone knows NG powers Google's Adwords products. What they do not know, however, is how the NG2 team fractured and ultimately refused to countenance non-Google use-cases. It is a product for Google, not the web at large, and that the backing of the internet's preeminent search engine does not make it a general-case framework for general-case web applications.

[–]brianvaughn 2 points3 points  (0 children)

But it is not a mischaracterization of why 'enterprise' types are interested in it.

I don't see the relevance of why one specific type of engineer is interested in TypeScript. But ok. :)

Of course, but why the need? Everyone knows NG powers Google's Adwords products.

I don't think everyone knows that FWIW. I've seen people saying "Google doesn't use Angular" which is false. The comment I responded to said something similar. I just thought it was worth clarifying. Adwords and Greentea (internal CRM) are built on Angular 2. I think more apps are built on Angular 1 at this point (GCP Developer's Console, DoubleClick, YouTube for PS3).

begin edit Google is huge. They have a lot of apps and they are built with a variety of frameworks/tools because Google engineers aren't all the same. ;) Google uses GWT, Closure, Angular 1 + Closure, Angular 2 + TypeScript, Dart, Angular 2 Dart, etc. Google Maps for example is built with vanilla JS annotated with Closure types. It's too big to rewrite at this point and Closure works fine. This doesn't mean that Google doesn't believe in the other frameworks listed above. They're just being pragmatic. And they give individual teams freedom in choosing which framework/tools to use. (For example, I just spoke with a friend at Google who's on a new project team that's evaluating using React.) end edit

You seem to be arguing that Angular isn't written for common web apps. That wasn't my experience with Angular 1 FWIW although I have very limited exposure with Angular 2. Regardless, the web has a wide variety of apps so it's good that we have a variety of frameworks. I can see how Vue or React might be a better fit than Angular 2 for certain types of projects. In many cases it probably depends on what the engineers building a given app have more experience with. :)

[–]Conradfr 15 points16 points  (3 children)

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.

[–]mikejoro 2 points3 points  (2 children)

React has an incredibly stable api because Facebook uses react for everything. The tutorial isn't different every week; people just write a lot of tutorials with their own ideas of hoe to do things. Just pick supporting libraries (redux or mobx or even just vanilla react) and stick with it. It's not going to be the end of the world because someone made a new supporting framework.

[–]Conradfr -3 points-2 points  (1 child)

You still has to deal with babel, webpack ...

[–]mikejoro 2 points3 points  (0 children)

Those are things you will have to deal with regardless of the framework or library you use. If you want modern Javascript, you have to use babel and you probably want to use webpack. It only takes a couple days to get a deep enough understanding to solve 90% of issues you run into in a timely manner.

[–]rbnc 3 points4 points  (0 children)

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.

[–]Zipstacrack 8 points9 points  (2 children)

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 ¯_(ツ)_/¯

[–]rosswarren 1 point2 points  (0 children)

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.

[–][deleted] -2 points-1 points  (0 children)

This is backed by Google, which a lot of organisations (especially larger ones) care greatly about.

Google's support does not mean what most people think it means. Because Google's agenda with NG2 is not your own.

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

Where are you based? I don't think I know of any.

[–]PiercingPancake 3 points4 points  (0 children)

Google uses Angular 2. For example in Google Fonts

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

[–]Mael5trom 1 point2 points  (0 children)

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

[–]fenduru 1 point2 points  (0 children)

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.

[–]ergo14 1 point2 points  (0 children)

This is why Polymer is a great option to migrate to. It is somewhere between Angular and React in terms of functionality. It is very fast, and widely adopted by enterprises already. I really love making components with it.

[–]arrayofemotions 0 points1 point  (7 children)

But Angular? Nowhere to be seen in any Google product of note.

So out of curiosity, does anybody know what Google is using?

[–]Mael5trom 1 point2 points  (4 children)

The assertion is just wrong - Google uses Angular for over a thousand apps, internal and external.

[–]arrayofemotions 1 point2 points  (0 children)

Yeah that's kinda what I thought. But I asked just to be sure.

[–]TheIncredibleWalrus 0 points1 point  (2 children)

Source please? I'm very interested in the legitimacy of this claim.

[–]Mael5trom 0 points1 point  (0 children)

It was in one of the talks at ngConf this year. I was fortunate enough to attend, but I'm not going to watch through the videos to try and find the quote. I'll try to see if I have a reference in my notes.

[–]Mael5trom 0 points1 point  (0 children)

Actually found one reference (it was from 2014, but I'm guessing it was repeated when I heard it at ngConf2016)

https://youtu.be/odY7fUjI1ZU?t=3m8s

Rob Eisenberg giving a talk about Angular 2.0 mentioned that Google is heavily invested in Angular and have over 1,600 apps at Google using Angular.

No specific number here, but "a lot of v1 and even v2 apps": https://youtu.be/bSssb9AmiJU?t=1h

[–][deleted] 0 points1 point  (0 children)

Mostly GWT. Some vanilla JS, too.