5 ms·
While most of the arguments presented in this article are somewhat valid but I hope with the release of Angular 2.0 majority of the issues will be addressed (th
by hassanzaheer_ 12y ago
While most of the arguments presented in this article are somewhat valid but I hope with the release of Angular 2.0 majority of the issues will be addressed (though does it make sense to make such drastic changes in the upcoming is another debate and already taken care of at: https://news.ycombinator.com/item?id=8507632 https://news.ycombinator.com/item?id=8507632)
I'm currently working on a comparatively large webapp built in Angular and it was after about 7 months into the project that we started realising it's pitfalls, and it was very difficult to abandon it then.
So we worked it around by:
1) using one-way binding (or bindonce to be exact) to reduce watches
2) avoiding un-necessary $apply() and using $digest() carefully if required
3) using ng-boilerplate for scaffolding
4) defining our own style guides/coding conventions/design patterns to overcome Angular's bad parts
5) frequent code-reviews that made sure new team members are upto speed with the above techniques
luckily we haven't ran into much issues after that :)
- lalwanivikas 12y agoIf you were given a chance to choose your stack again, what would you pick now? (Considering all the learning you have gained after going with Angular for your large web-app)
- hassanzaheer_ 12y agoActually it depends more on the time of development and project specs. For now I'll probably choose ReactJS. If by the time Angular 2.0 is launched then I'll definitely give it a shot, it seems promising and is based on ECMA6 utilizing the new features provided by it will be a plus. IMO AngularJS can be scaled _IF_ used with caution, though I won't recommend it unless one has a good experience with its core.
- Cthulhu_ 12y agoBut ReactJS isn't a full replacement for AngularJS (and I don't see why people apparently fail to make that distinction); React is just the V in MVC, Angular is / can be the rest.
- hassanzaheer_ 12y agoHaven't used ReactJS much but it looks promising in solving the problems created by AngularJS for instance its push-and-pull mechanism for data binding is efficient than angular's 2-way binding using watches... > React is just the V in MVC, Angular is / can be the rest. that's why its more of a micro-framework, its pluggability with other frameworks makes it customisable according to the proj requirements
- woah 12y agoThere are a lot of routers, http abstractions etc. out there. What people mean is "use React, along with some of the readily available modular ecosystem that exists already"
- jasim 12y agoI've seen many people repeating it; but I don't know what it even means. It definitely is the V - since it renders the view. But it is also the C - a component encapsulates the view and view logic together. From within the component, you have lifecycle events: when the component is mounted for the first time, whenever it receives new properties, when it is unmounted etc. In any of these events, you can receive data from the external world through AJAX calls. Or you can set up AJAX calls from outside the component, and in its callback, ask React to re-render the component. There are as many ways to update the data model inside the component as we can possibly do with Javascript and callbacks. This is exactly what a Controller in a traditional MVC does: orchestrate data flow between the external world and the view. React does it beautifully. React can also be the M, or it can compose it into the component. You can have your own validation methods and business logic that mutates the state in the component (a component is simply a Javascript object with state); or you can compose your custom Javascript object or something like Backbone.model, and keep all your logic in there. And you can use react-router for routing. What else do we need to compare React with Angular?
- lfischer 12y agoI think the point is a bit moot. Since it’s just JavaScript, you can put pretty much any logic in a React component just like you could also put any kind of logic in an PHP template or inside a view in iOS.
- andrewstuart2 12y agoI think around 7 months into any project you start to realize the pitfalls of whatever technology you're using. You've done the easy things after 7 months, and the hard things are always going to be hard.
- hassanzaheer_ 12y agoTrue. And like any other framework one can work around the bad parts by developing custom solutions, but Angular's one of the main features are its two-way binding which also happens to create one of the biggest performance bottlenecks as the application scales up. This can be fixed easily (bindonce is just one example) though it leaves Angular with little value.
- cmdkeen 12y agoAngular 2.0 seems to be a long ways off - to the point where the presenters wouldn't show actual code examples in their demos of it at ng-europe. It rather makes me worry it is going to be the Python 3000 release all over again in terms of how much is changing.
- Alex3917 12y ago> It rather makes me worry it is going to be the Python 3000 release all over again in terms of how much is changing. The underlying technology is changing so fast (ES6, web components, mobile web, etc.) that it's going to make upgrading an obvious choice even if it involves relearning a lot of stuff.
- hassanzaheer_ 12y agocouldn't agree more on the Python example, I think one of the main agendas for the 2.0 release will be to make it more popular on mobile side of things (https://www.airport-parking-shop.co.uk/blog/built-app-2-weeks-using-ionic-framework/ https://www.airport-parking-shop.co.uk/blog/built-app-2-week... is one such example though not from the core AngularJS team) for which they may have compromised backward compatibility infavour of performance. and also do you think they'll continue with the 1.x releases? since so many developers have already invested time and effort on their webapps and shifting it to an entirely new framework (read release) is a major cost to pay..
- Alex3917 12y agoThere is probably going to be at least a 1.4 release. The new 1.x dev team that Google just created talks about their plans for the future here: https://www.youtube.com/watch?v=LG9VkCDbte0&feature=youtu.be https://www.youtube.com/watch?v=LG9VkCDbte0&feature=youtu.be They say the exact plans for how long they are going to support 1.x won't be finalized until after 2.0 gets released, so that they have some idea of how difficult it's going to be to migrate.
- oinksoft 12y agoI've not gotten the same impression and expect Angular 2 to be out sooner than later. Here's a code example: https://github.com/angular/angular/blob/master/modules/examples/src/hello_world/app.js https://github.com/angular/angular/blob/master/modules/examp... It looks like `master' is all Angular 2 and coming along well.
- woah 12y agoWhy look forward to angular 2.0? I mean, it's a completely different framework, so why are you anticipating it, and not any of the millions of other new frameworks coming out?
- hassanzaheer_ 12y agoYou can find the detailed discussion in the HN link above, but to summarize my viewpoint on this: 1. It already has a much bigger and growing community than any of the new frameworks 2. It has backing/support of Google, when such a big company puts steam behind something than you can be sure it's not going to die out just like that, and will continue to grow and improve, no other framework other than ReactJS has such a portfolio 3. Third-party plugins/components, AngularJS already has some amazing libraries/plugins/directives built that one can easily plug into the project (this is by far greater than any other new frameworks coming out) and one can go on...