I ask because this post is a bit light on details and feels a bit angry to me. I'm not a front-end developer, but our dev team has not complained about Angular and I'm wondering if I'm missing something.
I ask because this post is a bit light on details and feels a bit angry to me. I'm not a front-end developer, but our dev team has not complained about Angular and I'm wondering if I'm missing something.
Angular is still, by far, the best framework I have ever used. I have zero regrets about choosing it.
This post reflects the pathological nonsense that pervades certain quarters of front-end development. It demonstrates the following fallacies:
1. If a technology has any flaws, they render the whole thing worthless.
2. New technologies that I haven't tried are probably perfect and won't require any hacks.
3. Kids these days aren't doing any real programming like we did back when we coded in Backbone / jQuery / Raw JS / VBScript / Java / C++ / COBOL / Assembly / Punch-cards.
4. Syntactic sugar and abstractions are inherently bad, whereas writing a lot of boilerplate code is good for the soul.
5. Someone I respect doesn't like something, so I shouldn't like it either.
6. Old, widely deployed technologies are over-complicated, because people have built more complex systems with them than with new technologies, and thus have been forced to tackle more complex requirements.
7. I have worked with this technology for a while, and built up a corpus of specialist knowledge and hacks, therefore it is more flawed and than these newer technologies, which I haven't worked with and therefore only understand in a shallow way, and therefore seem simpler.
8. Acquiring specialist knowledge is bad, and not the reason I am paid to do what I do.
I've strongly disliked angular as long as I've been able to code. On the other hand, I like react a lot even though it has a similar learning curve. React may have strange and unfamiliar concepts, but they are actually new concepts in ui development that make things less error prone, very performant, and cross platform.
If the angular team was not funded by Google, I doubt any of them would be working on it any more. Actually, with angular 2, that's the case anyway.
If you don't like dom-diffing frameworks, maybe check out vuejs. This is an observable framework like angular, but it's performance is acceptable and its api is very clean and makes sense.
• If a technology has flaws, that does not render the whole thing worthless.
• New technologies that you haven’t tried are not perfect, and will still require hacks.
• You have worked with some technology for a while, and built up a corpus of specialist knowledge and hacks. That does not necessarily mean that it is more flawed than some newer technology that seems simpler. That apparent simplicity is probably just because you haven’t worked with it and therefore only understand it in a shallow way.
• Old, widely deployed technologies are not over-complicated. It just seems that way because people have built more complex systems with them than with new technologies, and thus have been forced to tackle more complex requirements.
• Acquiring specialist knowledge is not bad – it is the reason you are paid to do what you do.
I like using Angular relative to Backbone and Ember, although my experience with Ember was last a year ago, and the framework has progressed a lot since then. I like React over Angular 1 currently, especially since it supports robust server-side rendering solutions. React takes some ideas from Angular such as not being opinionated with the models, but makes writing the core of its components much nicer than Angular 1's directives. It also does not take much opinions over the service architecture, which also makes me happy, but the tradeoff is that it leaves a lot of developers in the dark as far as how to organize code with it - that is why Facebook pushed the Flux pattern very strongly.
Angular 2 definitely took a lot of React's good points and integrated them in better ways into Angular 2, or have plans to integrate them. Ideas such as supporting immutable data, virtual DOM (well, at least something similar to virtual DOM anyhow), and unidirectional data flow make their way into Angular 2. Robust dependency injection (no more using $inject or the hacky array syntax for DI) and better API for creating components come as more evolutionary changes from Angular 1. The declarative templates are also a lot simpler, as expression support is more limited than the broad JavaScript-like syntax supported in Angular 1. Shadow DOM being a first class citizen of the framework makes having to worry about component CSS being clobbered a problem of yesterday.
Overall, I am excited as a frontend developer - there are a lot of exciting things happening in the frontend world, and the ecosystem is maturing by leaps and bounds.
- I can chuck away my angular 1.x knowledge, since Angular 2.0 is going to be completely different than 1.x (like Django and Node)
- Directives are such a pain to write, test, maintain, compose and reuse
- Doesn't scale (writing and debugging very complex app)
and also
- I had to dig deep down into internals to get how something works
- Angular has very step learning curve
- Harder to write isomorphic app
Having said that, Angular is an enormous improvement comparing to jQuery. If you start a new project, evaluate all options and pick what works best for you.
Angular ain't perfect, but it's still pretty damn good.
"The very fact that an article exists which prescribes that you should be mindful of the order in which you write your HTML attributes in Angular to optimize performance and other quirks is staggering."
No, the article linked to in support of this statement is talking about readability. Angular directives have a priority attribute that determines the order they're evaluated in.
Hating on Angular is just a trendy thing right now.
Its true in C++/Java/C#, but less so in JS, Ruby, etc. If you can change what a dependency refers to without using injection, as you generally can in the fact namuc languages, injection is less useful.
// foo.js
var request = require('request');
module.exports = function (url) {
request.get(url, function (err, body) {
// ... business logic here.
});
}
Here, if one wanted to test the actual business logic (without implicitly testing the request module as well), one would have to refactor the code such that the callback is somehow exposed to the test suite. Additionally, one would not be able to run such tests in isolation (i.e. without an internet connection), and the test speed would depend on network latency.Now consider another example:
// injected.js
module.exports = function (request) {
return function (url) {
request.get(url, callback);
}
}
In this version, the request library is taken as an argument to the module and thus can have a mocked version injected for testing purposes.https://github.com/johnpapa/angular-styleguide
I haven't had any beef with Angular so far, and really enjoy working with it. But I understand that one size doesn't fit all.
I'm kinda pissed with Angular too, to be honest. I agree with the author that there were some pretty bad ideas in there, and it grew in popularity so quickly that a lot of people are going to be dealing with those problems for a while. Personally, I left the job I was speaking of earlier in this post, and I don't use all-consuming frameworks like that anymore. Whatever work they save you in the beginning becomes a prison sentence later on when you're forced to do things their way.
Sure, Angular has its flaws & quirks, just like any framework. But it gets so many things right that it's worth sticking with it, IMHO.
I really love the structure Angular brought to our front-end softwares. At some point, we may include React to optimize the rendering of our realtime dashboard.
While working professionally, my team lead chosen Ember.JS.
Anyway, in general Angular have a very different way to do thing and you basically create html element and the js will defined the html behavior.
In general, I think the announcement of Angular 2 have slowed down the momentum of 1.0 very much. Angular 2 from what people have been saying is totally completely different from 1 and it could be name something else and noone could tell it's an angular framework from 1.
With all the js front end framework out there, I think it's too wild west and I rather let this area mature much more before choosing one. Unless you can afford to rewrite frontend code every few years... I'd stick with backend rendering web pages, plus it's SEO friendly.