3 ms·
Say what you will I like Angular 1. And there is a ton of resources and books all over the web to help.There is a solution to everything and it's pretty RAD Ho
by aikah 11y ago
Say what you will I like Angular 1. And there is a ton of resources and books all over the web to help.There is a solution to everything and it's pretty RAD
However, I'm very skeptical about Angular 2. For several reasons. First (I tested it) right now, it is way too complex and unnecessary verbose.
They wanted to support future techs like web components, observables (reactive functional programming) which are great, but it's not that easy to use.
Some people will not like the Rx approach which forces one to rethink the way one codes. There is serious mental gymnastic involved here when one has to think in terms of cold and hot streams, especially when one is used to ng1.
Of course, people who love Typescript will enjoy it,and it's true it's easier to figure out what is what with explicit types, but people who are sticking with ES5 for various reasons will hate all the boilerplate needed to get started.
And they went crazy with dependency injection,this time, this is a divisive issue among programmers and while ng1 DI was light weight, ng2 DI is going full Java which Java/C# folks will like, but i'm not so sure about the rest.
The biggest question is, how is ng2 relevant compared to React + Flux/Relay? since it tries to do the same thing but with more complexity? with that weird template syntax ([attr-read-from]="variable" , (event)="handler" ,[(read-write)]="variable", *template-directive="expression" ... )? React has JSX which is a serious advantage.
ng2 will be ready in a year at best but businesses can be tempted to just move to React in the meantime and then stick with that.
.
- Bahamut 11y agoI think if a business needs to, I would recommend they move to React now - Angular 2 is shaping up to be quite impressive, and taking pretty much all of the lessons that Facebook has brought with React (& possibilities brought about by the generally clean architecture such as server-side rendering, native mobile app support, etc.), and refining it ruthlessly, but you can only use what is available if you are consuming a third party library. Once Angular 2 is ready though, I would only consider using it in a new project unless the company is already deeply invested in React (or other tech) & doesn't have the time to migrate. Angular 2 is still rough today, and that is why it is still in alpha - the Angular team is still trying to figure out what do they need to expose in the framework for consumers to build flexible components. In addition, the testing situation still needs to be refined some. The UI Bootstrap team is in the beginning of migration to Angular 2, and we already came across some pain points that Google is working with us to try to ease as much as possible. As far as ng2 vs. React - ng2 uses pure HTML templates still. ng2 manages to use this and still optimize dramatically over React due to how change detection works in Angular. The template syntax is not complicated once you get used to it - it is much easier than remembering all of the edge cases that JSX has had to write around (i.e. className) due to issues of conflict with JS itself, and certainly much easier than remembering all of the little caveats and edge aspects of ng1. Web component support for Shadow DOM is opt-in, and it does use the template tag for custom components. Observables have some overhead, but the great thing is that it is optional for many things, and easy to use when something is exposed as an observable. The Angular 2 DI is much better than the Angular 1 version - it is much more powerful and doesn't require a hacky implementation due to its use of decorators.
- aikah 11y ago> ng2 manages to use this and still optimize dramatically over React due to how change detection works in Angular. That's what the angular team claims yet, there is absolutely no proof that ng2 templates are faster than React, and I did my own benchmarks. You can say "it's still alpha" , but if speed is a business requirement for ng2, alpha doesn't fulfill that promise. > The Angular 2 DI is much better than the Angular 1 version Better or more verbose and complicated ? I just don't want to do that kind of DI in the front-end. It will lead to people over engineering their code bases. It will lead to bad and verbose code, everything what front-end development should not be.
- Bahamut 11y agoActual benchmarks would disagree with your claim - the Meteor team did a benchmark and found Angular 2 significantly faster than Angular 1 (I hope so), React, and their own Blaze. The perf gap increases dramatically with the more DOM elements worked with - the best part is that the Angular and Meteor team's benchmarks are both open source! (The Angular team does not compare with React, just Angular 1 and a baseline of no JS generated DOM) The problem I have found with most codebases written with angular is by far the underengineering put into it, sometimes to an appalling degree. The new DI is pretty simple - specify an array of services, or just define the array elsewhere and import it in and set it to a config onject. There is not much complexity on the user's side.
- aikah 11y ago> the underengineering put into it, There is no such things as underengineering, given specific business requirements. On the other hand, writting useless code is something I often see with people abusing IoC containers like Spring. If a minimal codebase passes the acceptance tests it is not "underengineering" ,it's actually doing one's job as a developer. Anyway i'm really against the lack of pragmatism in the new DI. But don't worry , by the time ng2 is realised you'll see an avalanche of blog posts about how horrible it is. Mark my words.
- 11y ago