Showing posts with label about. Show all posts
Showing posts with label about. Show all posts
Thursday, September 15, 2016
Things I dislike about AngularJS
Things I dislike about AngularJS
Update: I was watching the development of AngularJS 2.0 with interest due to its modern ES6 approach, but the lack of backward-compatibility irked a lot of die-hard 1.x fans and caused a mini-exodus, including Rob Eisenberg. Rob went on to create a JavaScript platform/framework called Aurelia that looks as promising as Polymer so Ive updated my recommendation below accordingly.
~~~~~
Preface: I like Google and the goals of AngularJS and my intention is not to start a flame war, but it seems there are a lot of drink-the-Kool-Aid! posts about how awesome AngularJS is and I wanted to provide some counter points of caution (based on my experience) of what I dislike about the current state of AngularJS:
Documentation is spotty and the API is so complex you cant code without constantly referencing it (i.e. non-intuitive)
- https://news.ycombinator.com/item?id=6152291
- http://www.reddit.com/r/javascript/comments/1ecbjn/polymer_a_new_web_framework_by_google_designed_to/ca17bk8
- http://www.jacopretorius.net/2013/07/angularjs-pain-points.html
- http://blogs.lessthandot.com/index.php/WebDev/UIDevelopment/angularjs-vs-knockout-final-thoughts-9
- http://lhorie.blogspot.com/2013/09/things-that-suck-in-angularjs.html
Too many service types with overlapping functionality and poor guidance on proper use cases
- http://angular-tips.com/blog/2013/08/understanding-service-types/
- http://slides.wesalvaro.com/20121113/#/2/7
- http://docs.angularjs.org/api/AUTO.$provide#comment-891008169
Non-intuitive terms, such as transclude, which refer to non-intuitive concepts, such as:
"transclusion refers to compiling the content of the element and making the source available to the directive. The transcluded function is pre-bound to the calling scope, so it has access to the current calling scope." source
Directives are prone to memory leaks
- http://stackoverflow.com/questions/17203005/angularjs-directive-destroy
- http://odetocode.com/blogs/scott/archive/2013/07/16/angularjs-listening-for-destroy.aspx
Custom $digest loop and $watch dirty-checking arent designed to scale well for slow mobile devices, heavy processing, or 50+ fps
- http://mrbluecoat.blogspot.com/2013/08/in-regards-to-javascript-library.html
- https://www.youtube.com/watch?feature=player_detailpage&v=ZhfUv0spHCY#t=1992
- http://angular-tips.com/blog/2013/08/removing-the-unneeded-watches/
- http://www.bennadel.com/blog/2489-How-Often-Do-Filters-Execute-In-AngularJS.htm
- http://www.bennadel.com/blog/2472-HashKeyCopier-An-AngularJS-Utility-Class-For-Merging-Cached-And-Live-Data.htm
- https://www.youtube.com/watch?feature=player_detailpage&v=VO--VXFJnmE#t=530
- http://wesleyhales.com/blog/2013/10/23/Basic-Screen-Updates-with-Angular-and-requestAnimationFrame/
- https://www.youtube.com/watch?feature=player_detailpage&v=mfOh-J-9BY0#t=120
No namespace enforcement or best practices can lead to naming collisions
- http://www.ng-newsletter.com/posts/directives.html#comment-1022617766
$ variable prefix is confusing when mixing code with jQuery (also confusing to use $scope in controllers but scope in the link function)
Auto camel-to-snake-to-camel casing is confusing to programmers new to Angular, muddles code tracing, and is easy to forget to transpose in the correct context
Too much secret decoder ring enigma code:
restrict: EA,Allowing directives to be defined as CSS classes is confusing for code maintainers (e.g. "Is this a CSS class or a directive?")
require: ^?ngModel,
scope: {
ngModel: =,
foo: &,
bar: @
}
- Yes, I know I dont have to define directives as a CSS class, but its the principle that I can that bothers me. If I inherit code that uses AngularJS, I am now no longer certain if class="foo" refers to a CSS class, an Angular directive, or both. It also makes code refactoring much harder.
Explosion of widely available, loosely moderated directive code may result in difficult maintenance and security protection (e.g. "Where did this directive come from? What version is this directive? Is there a newer version? Are there known security vulnerabilities with this directive? Is there a more robust or popular directive out there for this functionality? ...")
___________________________
For the moment, Im putting my money on Polymer (check out their elements catalog) or Aurelia (see comparison to Angular 2.0 here and here). Others seem to like Closure. Another one to keep an eye on is Riot / RiotControl.
Go to link download
Saturday, August 20, 2016
Whats so special about Polymer
Whats so special about Polymer
Desktop visual coding tools (like Visual Basic), Server-side Content Management Systems (like Drupal), and package managers (like Nodes NPM) have enjoyed the concept of modules and features for years, but due to the limitations of the current version of JavaScript, browser differences, and security restrictions, the possibility of a pure client-side equivalent has been elusive.
Although proprietary attempts were made (such as Flash components), Dojo was one of the first major open JavaScript attempts at bridging that gap. By encapsulating logic in separate JavaScript files that were injected dynamically with dependency handling, it was now possible to develop complex, maintainable modular applications. Unfortunately, Dojo was ahead of its time and the face-off between declarative and imperative finished with jQuery as the clear winner.
Recently, though, AngularJS has resurrected the declarative appeal by adding useful power boosters such as automatic two-way data-binding, filters, and feature encapsulation via directives. Unfortunately, to perform this magic it creates under the hood a proprietary parallel universe called Angular execution context that implements a potentially expensive brute-force dirty-checking technique and a fairly steep learning curve. That said, the library is gaining strong momentum and popularity so as the saying goes where the community drives, the specs will follow.
To that end, the W3C and TC39 gurus have been working diligently at forging a bright future (full of Object.observe, Shadow DOM, and template awesomeness, among others). ....All we have to do is wait 20 years for the browsers to catch up, right?
Well, theres hope that Polymer will not only polyfill / prollyfill our way across the void but provide just the right balance of opinionated guidance and a thin layer of sugar (pre-built web components, Mozilla X-Tag/Brick support, etc.) to point us towards success.
New? No. Unique? Not particularly. Helpful? Yes.
Go to link download
Subscribe to:
Posts (Atom)