|
|
|
|
|
by EGreg
4151 days ago
|
|
Why is it hard to reason about event based code? A framework will need the flexibility to enable any developer of any component to do what they need when something happens. That is what an event system enables. If you want the events to be a directed tree, that's basically what angular 2 implements. Immutabilty is optional. I can easily visualize a tree and reason about it. Gotos are very different. What you wrote seems like a bit of equivocation. The parent creates the child (or at least it should, in my opinion). The parent should just give the child the callbacks it wants directly That's what setting event listeners is. The parent knows about the interface of the child, not necessarily the other way around. So the child won't be able to know what callbacks to call. That is also why inversion-of-control leads to more stable platforms. |
|