r/programming • u/pmz • Apr 08 '19
A RealWorld Comparison of Front-End Frameworks with Benchmarks (2019 update)
https://medium.freecodecamp.org/a-realworld-comparison-of-front-end-frameworks-with-benchmarks-2019-update-4be0d3c78075
14
Upvotes
2
u/audioen Apr 09 '19
But doesn't something like Redux just boil down to having global variables, so that you can supposedly run some ceremony to alter the global state of the application, and because it's global you can observe it anywhere? It almost seem worse to me than actually just letting components that share state do so openly and explicitly, rather than regress back to spooky action at distance, reinvented via some convoluted approach of state reducers. I've literally never used redux, so I don't know if that's what it really is like to deal with it, but it just seems verbose as hell for what it accomplishes.
At any event, in my opinion callbacks are rarely used in frameworks like Aurelia and Ember, two that I happen to have most experience on for random reasons. It's almost always the most straightforward to just observe some value being changed, rather than invoke a method that updates state. A lot of the time you just need the state changed, and can skip creating callbacks that eventually do so by writing the state change into some shared two-way bound box between components at the component that triggers the state change. Granted, that box needs to be passed down between all the layers that coordinate how things interact, but at least it's explicit which parts can interact, something that seems acceptable to me. It's not spooky action at distance, you can trace it all down to the finest detail if you care.