r/angularjs • u/weitingliu • Nov 25 '14
[General] In Defense of AngularJS - Why You Should Continue Using AngularJS
https://www.codementor.io/angularjs-tutorial/angularjs-2-criticism-defense?utm_source=reddit-tutorial&utm_medium=blog&utm_term=angularjs-2-defense&utm_content=blog&utm_campaign=reddit-tutorial2
u/dardan_aeneas Nov 25 '14 edited Nov 25 '14
The article has little real substance. It mainly suggests that those who don't like AngularJS just don't understand AngularJS.
How about an article addressing the following:
AngularJS 2.0 is complete rewrite, almost a different framework entirely, which makes AngularJS 1.x a dead-end. Applications written in Angular today will not get new features or core improvements without a rewrite to Angular 2.0.
Also, why would the Angular team do this unless: a) the team leading Angular is incompetent, or b) Angular has real deficiencies?
Either way, that is something in the "cons" list for Angular.
EDIT: formatting, typos, it was too long
8
u/jjperezaguinaga Nov 26 '14
Original OP here. I'm going to address each of your points specifically.
AngularJS 2.0 is complete rewrite, almost a different framework entirely, which makes AngularJS 1.x a dead-end.
As mentioned on the ng-europe recap: “(...) With over 1600 apps at Google built with Angular 1.x, we are committed to supporting it as the first class AngularJS version for a long time to come.” Dead-end is a strong statement. I would just simply describe that writing on AngularJS 1.x has a higher risk than before, because at some point migration will need to be addressed.
Applications written in Angular today will not get new features or core improvements without a rewrite to Angular 2.0.
This is correct, thus, the importance of migration. Whether this is easy or not, is a task yet to be defined by the AngularJS team.
Also, why would the Angular team do this unless: a) the team leading Angular is incompetent, or b) Angular has real deficiencies?
Answer is b), but not deficiencies on the way you think deficiencies are. You see, AngularJS started on 2010, and the 1.0.0 release was on 2012. We are almost on 2015 right now; browsers have changed drastically and the API's they support today are completely different than the ones they supported on 2010. AngularJS vision of 2.0 is geared towards the future, while the first release of AngularJS was set towards the present, at that point in time.
AngularJS 2.0 migration is a topic on its own. My take on it at the moment is that until I don't see a migration path, there's little to be said. We just like our new toys to be as compatible as possible, and that's not always the case when the playground has changed so much.
The article is meant to be a defence on AngularJS ideology, and why it's being targeted lately, and the pitfalls of this targeting. It's unfair to call it to have “little substance” when you focus on 10% of its content.
3
u/permabed Nov 26 '14
Also, why would the Angular team do this unless: a) the team leading Angular is incompetent, or b) Angular has real deficiencies?
Hello. Since their will be module and classes in ES6 and they want to use ES6+ features, you are missing a case. I think thanks to ES6 module (eg 'import blabla from coolModule'), you will not need angular.module for example. They want to use new possibilities offered by the underlying technology without forgetting to backport the new wonderful ng 2.0 to the crappy world of ES5
I really don't like how all those javascript framework goes everywhere for my everyday work (it's like cancer, cells going everywhere in every direction) but it seems to be a needed step before the stabilization phase. Those people are still in exploration phase and we can see it with all those framework trying to addressing to different kind of issue and we can't blame them to try to find a solution using the best hammer, screw driver... of
todaytomorrow. And finally, we should be happy that some people are taking some time and giving some money for this exploration phase!2
u/jij Nov 26 '14
Also, why would the Angular team do this unless: a) the team leading Angular is incompetent, or b) Angular has real deficiencies?
I find it's usually when people get too far into the technical side of things... always wanting to refactor it, do it the way they feel it should have been done from the beginning, while they're imagining their perfect architecture that they're sure everyone will love and deal with the painful switch becuase it's just so much better in their mind.
I think IPv6 shows how ridiculous that view is. Without backward compatibility, it's essentially new project and people very well may prefer the old one... python3 is another example, it's been how many years, and so many people are still on 2.7
1
u/nerdyhobby Nov 25 '14 edited Nov 25 '14
I feel the same way.....
Sadly, I can’t share the code, but I can tell you something: it’s a mess. It’s the sum up of constant learnings over a year, mixed philosophies and strategies by people that did it’s best to deliver a product. And you know what? That’s fine. Because by 2014, I guarantee you that most of the people involved in the project could redo the application by painting a proper roadmap for its features, define the architecture, code guidelines and practices to avoid, while still meeting a deadline. And all of that in AngularJS.
I think that applies to a lot of things. Take framework X, use it to build a large application. You end up with a mess. In the end, you will (almost always) have take-aways of what you did well/ not-so-well. If you had a chance to re-build it again with X, after building it once, of course, you would be able to have a clearer roadmap, define or even improve the architecture, etc, etc.
You can use any other library as you want, but you need to “wrap it” properly for AngularJS to use it.
I kinda chucked at this one a little bit. What is "wrapping" specifically?
... and all projects made in AngularJS will spontaneously burst in flames”. See, nothing of that will happen. What will happen is that mature projects with a decent codebase will eventually plan migration to AngularJS 2.0, because redoing the whole application in something else would be a waste of time and resources; by doing so, they will eventually benefit of the performance improvements ....
Too optimistic. From what I understand, there is no migration path from 1 to 2. This means that migrating to 2 is almost an equivalence to
redoing the whole application in something else. He talks about mature projects with decent (whatever that means) codebase. What happens to the other projects? Like the one he built that ended up in a mess?And let's be honest, what percentage of mature projects actually have
decentcodebase?3
u/joshuacc Nov 26 '14
From what I understand, there is no migration path from 1 to 2.
Your understanding is incorrect. The Angular team has stated on multiple occasions that there will be a migration path. From their blog...
Once we have an initial version of Angular 2, we'll start to work on a migration path for Angular 1 apps.
1
u/nerdyhobby Nov 26 '14
Thank you for clarifying. I got my info from
http://www.infoq.com/news/2014/10/angular-2-atscript
I really hope that they keep these things in mind as they build Angular 2. I guess only time will tell.
2
u/e82 Nov 25 '14
If you are using a library that isn't geared towards angular, a general practice is to do something like
angular.const("someLib",window.someLib);then in a service/whatever that needs someLib
angular.factory('myThing',function(someLib) { });If you are using jQuery plugins/etc - it's pretty common to need to wrap them in a directive to be able to use $scope.apply/etc to make angular aware of what's going on.
If the library is available globally - you could just use it w/o needing to inject it like that, but by doing it like the above it gets easier to mock it out for doing tests/etc.
1
u/nerdyhobby Nov 25 '14
Thanks e82, yea I understand what he means, but I think the author needs to provide som sort of evidence that Angular actually does work well with others rather than just handwavily telling people that they can just "wrap" it.
3
u/adam_bear Nov 26 '14
I really like Angular, but I like React better...