V

Victor Savkin

victorsavkin.com · Personal blog · on HN since 2012

Victor Savkin, a former Angular core team member, writes about Angular 2 internals, state management, routing, and programming practice.

What HN saysHN commenters cite his posts on Angular 2 change detection and state management, and debate one-way versus two-way binding and performance claims.
26HN people shared it
7linked it in comments
71stories submitted
317story points
10 years agolast shared
2012people per year2026

Most-shared posts

  1. 1
    Change detection in Angular 2
    8 people · 8 points · first shared 2015 · discussion on HN
  2. 2
  3. 3
    Mindful Programmer
    3 people · 7 points · first shared 2015 · 1 comments on HN
  4. 4
    Why JavaScript Needs Types
    3 people · 5 points · first shared 2014 · discussion on HN
  5. 5
    Angular 2 Template Syntax
    3 people · 5 points · first shared 2015 · discussion on HN
  6. 6
    Angular Router
    2 people · 8 points · first shared 2016 · 1 comments on HN
  7. 7
    The Core Concepts of Angular 2
    2 people · 6 points · first shared 2015 · discussion on HN
  8. 8
    Deep Work
    2 people · 5 points · first shared 2016 · discussion on HN
  9. 9
    Building Angular Apps Using Flux Architecture
    2 people · 4 points · first shared 2014 · discussion on HN
  10. 10
    Functional Refactoring in JavaScript
    2 people · 4 points · first shared 2013 · discussion on HN
  11. 11
  12. 12
    Better Support for Functional Programming in Angular 2
    2 people · 2 points · first shared 2015 · discussion on HN
  13. 13
    Two Phases of Angular 2 Applications
    2 people · 1 points · first shared 2016 · discussion on HN
  14. 14
    Why Every Ruby Developer Should Learn Smalltalk
    1 people · 106 points · first shared 2012 · 66 comments on HN
  15. 15
    Contrasting Backbone and Angular
    1 people · 64 points · first shared 2013 · 23 comments on HN

What HN people wrote when they linked it

robwormald · 2016-05-03
This was the case in Angular 1 - in Angular2, not so much. The component-tree structure (much like React) allows far smarter optimization on change detection - both with immutable data structures and observables - entire subtrees of components can be removed from the change detection step until the state notifies it of a change. Good reading material by a team member - http://victorsavkin.com/post/110170125256/change-detection-in-angular-… and http://victorsavkin.com/post/114168430846/two-phases-of-angular-2-appl… An early beta comparo - http://www.roblog.io/js-repaint-perfs/angular2/opt.html vs http://www.roblog.io/js-repaint-perfs/react/opt.html - should probably update these with the latest RC.
filoeleven · 2015-08-25
Others have pointed out that it is in fact syntactically valid HTML. It's also worth mentioning that this is syntactic sugar, and you can get the same behavior with: <input type="text" bindon-ng-model="model.name"> Similarly, property bindings surrounded by brackets "[myprop]" and event bindings surrounded by parens "(myevent)" are equivalent to the following: <input type="text" bind-myprop="model.foo" on-myevent="bar()"> All of angular2's template syntax can be replaced by more normal-looking tag properties with "reserved" prefixes that tell Angular what to do with them.[0] The less verbose symbols are probably easier for the eye to parse than the long forms once you're used to them, and either form can be easily analyzed and highlighted by an IDE. [0]http://victorsavkin.com/post/119943127151/angular-2-template-syntax
Bahamut · 2015-09-01
Where's your proof that is simply not true? Every talk where people have done actual benchmarks with has shown otherwise. I have also discussed benchmarking techniques with the main Angular developer in charge of them, as I noticed some statistical issues with the original approach when they started presenting them, and they refined ruthlessly from there. Different people have presented on them - Uri Goldshtein gave a talk within the past month at the AngularJS Mountain View meetup where he personally benchmarked React, Angular 1, Angular 2, and one other library using Meteor with all of them, and the findings were very interesting - React started struggling around two marks, including around the 20k element mark (I may remember that number slightly wrong) & 50k element mark (which is a bit of a contrived benchmark IMO), but the remarkable aspect was how linear Angular 2's performance was. React's showed a more complicated picture, at times behaving like a quadratic. Angular 1.x also shows similar patterns, which is consistent with every benchmark people have presented in talks or blog articles. At large numbers of DOM nodes in a simple flat tree, most libraries showed issues - React would take over 3.5s to render at over 100k elements, whereas Angular 2 performs amazingly at under 100ms on the same test. Unfortunately, this talk was never uploaded due to Google having had video issues, but it looks like the findings were made available here:…
danabramov · 2015-02-07
>We want to apply values to variables and get the DOM updated. The popular two-way data binding should not be a feature, but a must-have core functionality. Strongly disagree. I find one-way bindings and one-way data flow much easier to reason about. A little less boilerplate code is not worth mental overhead, cascading updates and hunting down the source of wrong data in my experience. What is important is not updating the DOM from the code and instead describing it with a pure function. React, Cycle, Mithril, Mercury do it, and it's time we get used to this. This is the real timesaver, not two-way bindings. `Object.observe` is the wrong way to approach this problem. If you own the data, why invent a complex approach to watch it, if you could update it in a centralized fashion in the first place? Here is a great presentation on that topic: http://markdalgleish.github.io/presentation-a-state-of-change-object-o… I strongly suggest you read it ("Space" to switch slides) if these ideas are still alien to you. Even Angular is abandoning two-way bindings. http://victorsavkin.com/post/110170125256/change-detection-in-angular-… I, for one, welcome our new immutable overlords.
david_p · 2016-06-27
It's more mature now that the Angular 1 experiment is over It's written in TypeScript, so you can write your frontend in TypeScript. Many bugs averted. You can use a real reactive model (http://victorsavkin.com/post/137821436516/managing-state-in-angular-2-…
yesimahuman · 2015-04-06
Right now, it's event driven: input triggers an event, event is handled in component, component state is updated. For the one-way case (that I think is pretty awesome): a zone is set up in the component to detect changes locally in the component (even changes in setTimeout) and update the components template only. I think there's room for a 2-way like wrapper for the common input use-case (ala ngModel). Still digging in though. (way more info on change detection in v2: http://victorsavkin.com/post/110170125256/change-detection-in-angular-…
bceagle · 2015-02-27
Changes in Angular do not trigger a full re-render. The thing the author is trying to point out is that changes trigger a digest cycle and a digest cycle can (in some situations, not all) take a long time to figure out what has changed. But, once it figures out what has changed, it will only change those specific elements in the DOM. At the end of the day, what we are talking about is Angular 1.x is not as efficient as React at figuring out what to modify in the DOM. However, just be aware that this will all change in Angular2 where you can use an immutable data structure (just like React) or observable (if the situation warrants it) to quickly figure out what DOM updates need to occur. Read here for more: http://victorsavkin.com/post/110170125256/change-detection-in-angular-…

Keyboard shortcuts

/Search
j kNext / previous blog
EnterOpen selected blog
vVisit the blog site
fFollow / unfollow
lSwitch grid / list view
dSwitch dark mode
g hHome
g pTop posts
g tTopics
g fFollowing
g lLiked
g yHistory
g qFAQ
EscBack / close