Pillars of AngularJS 2.0 Approach – Why AngularJS 2.0 will Rock!!!!
About a year and half ago, the AngularJS team made the decision to drastically change the tremendously popular AngularJS framework. Google and the Angular contributors (including robust community) sought to better the framework by reducing the learning curve and providing performance enhancements. Big changes are unleashed with AngularJS 2.0, this surely makes the migration path somewhat unclear as well as challenging still overall with aim to make framework Fast, Universal and Flexible this is a step in correct direction. The direction that the AngularJS team has taken is bold but positive.
As the application development world is gearing up and waiting for production release of AngularJS 2.0 there is a lot of talk about direction taken by AngularJS team. However very few are aware of the approach adopted by AngularJS 2.0 to tame various challenges faced by the industry today. Lets try to understand what AngularJS 2.0 is trying to achieve in already crowded JS framework ecosystem.
To demystify AngularJS 2.0 the idea of this article is to focus on approach more than the execution of the approach. The four main concepts driving AngularJS 2.0 philosophy are Mobile First, Loosely Coupled Modules, Simplicity and Performance. Lets try to dissect each of these concepts and understand their impact on the application development landscape.
Mobile First - The AngularJS team has expressed time and again (via blogs, conference speeches, meetups) that they would go for mobile but very few thought or had conviction that it would mean the team will focus most efforts to get mobile right first and then work up to desktops. While it seems appropriate, with the extraordinary growth of mobile Internet access over past few years and exponential rise in number of smart phones activated every day, still surely this is a bold and without doubt a brilliant approach. Many application development platforms or tool chain players have talked about or recommended this approach for more than 3 years now especially for building an application that needs to live in both mobile and desktop platforms, however, not many have put it in execution whole heartedly. Surely facts remains that if you do it right on mobile and are able to tackle loading times, performance and other mobile challenges first, then desktop becomes a much easier task.
Loosely Coupled Modules – The AngularJS Team has been detaching modules from its core for several versions now hence while this is not at all surprising and was expected but with AngularJS 2.0 this approach has become more prominent. From mere process in earlier releases this has become approach in current release especially with the community becoming more active, innovative and connected (with AngularJS team as some of the modules have been adopted and have worked as options for some core angular modules) and started to offer some very interesting and impactful modules such as angular-ui, angular-translate, ui-router, ng-table and restangular. Further the AngularJS team and the community has successfully built a module ecosystem that keeps growing with every passing day (www.ngmodules.org holds nearly thousand modules and many more available but not indexed) hence proving this approach of “Loosely Coupled Modules” a great success. This approach also has an additional benefit that the smaller libraries or modules combined with lazy loading not only generate a huge boost on performance but also makes managing code easier.
Simplicity – Out of many goals for AngularJS team, one of the key goals for AngularJS 2.0 was to allow developers to concentrate on the lines of code related to their business domain and functional requirements. The focus is to better hide angular frame, annotations and ES6 provides the tools and standards to make this possible while ensuring the readability for developers to understand what is going on. Further the AngularJS team has also embraced feedback coming from a community who found directives syntax in older releases having a rather long learning curve hence not only using [properties] and (events) many directives that are not needed anymore are removed even the way of consuming directives is simplified. A much simple directives, like components, are incorporated to make the development simpler and easier for developers to adapt and adopt.
Performance - The AngularJS team expect the AngularJS 2.0 to deliver better performance (between 5 to 10 times). While incremental performance improvement was also seen in versions 1.3 and 1.4 however 2.0 surely takes it to next level. Key reasons driving the enhanced performance can be many including some discussed earlier in article but it would be pertinent to mention few of more reasons. First there is faster checking of a single binding. The mechanism to check a single binding was optimized in AngularJS 2.0 to allow the Javascript VM to optimize that code into native code via just-in-time compilation. Instead of scanning recursively a tree of objects, a function is created at Angular startup to see if the binding has changed. Further this binding-checking function looks like a function can be write to test for changes and can be easily optimized away by the VM. Second by avoiding scanning parts of the component tree. AngularJS 2.0 allows the developer to provide some guarantees to the change detection mechanism to avoid scanning parts of the component tree. Lastly AngularJS 2.0 bet on component-based UI instead of using controllers, similar to ReactJS it has dropped controllers. Seems that it is modern for the JavaScript MVW frameworks to drop controllers from their components (starting from Backbone.js).
Conclusion
As AngularJS becomes more popular, it also becomes a target. Especially due to bold approach taken by AngularJS team when they disrupted approach taken for AngularJS 1.X to take totally new parallel path for AngularJS 2.0 they are bound to see challenges, which are seen (or talked) today.
Also fact remains that it doesn’t matter the language, runtime environment, text editor or framework you use, programming will always suck (my personal view). However having an open-source framework that makes our life easier should come to all developers as a something from heaven.
So in my view, “AngularJS 2.0 will Rock!!!!”.
About Walking Tree
Walking Tree provides Design, Development, QA, Maintenance and Support, Consulting, Training and Skill Augmentation services around Ext JS, Sencha Touch, AngularJS, Xamarin, Native Android, Native iOS, MongoDB, Cassandra, Hadoop, Pentaho, etc. Walking Tree acts as a product engineering team of the customers across the globe and delivers end-to-end products / solutions to ensure "Great Experience". Walking Tree works closely with technology innovators and ensures that the team creates "Effective Software" based on thorough understanding of underlying technologies.
Co-founder at WalkingTree, Qritrim and EngazeWell| Generative AI, AI/ML and Product Engineering
9 年Indeed AngularJS2.0 will rock! You have articulated the whole thing really well. The initial promise by the Angular JS team ensured that the enterprise customers who wanted to build a cross-platform solution were okay to wait for the release of 2.0. At Walking Tree, we do see a lot of inquiries for the Angular JS talent and that is a clear sign that the time has arrived!