3 ms·
Simple state libraries are great for simple web apps, not for massive, enterprise-level applications. As someone who regularly investigates alternatives to redu
by qudat 6y ago
Simple state libraries are great for simple web apps, not for massive, enterprise-level applications. As someone who regularly investigates alternatives to redux, it still sits at the top of state management.
These intro how-to comparisons don’t do redux justice because being simple to use is not the stated goal of redux. Large scale, maintainable, and traceable code is the primary goal of redux. When you allow anything to update your state with zero form of traceability, you’ll start to see the cracks in these simple designs.
Are these new state management libraries easy to use? Sure, but what happens when you have tens of thousands (even hundreds of thousands) of lines of code to deal with and then add major refactoring objectives in the pipeline?
Like others have mentioned, if you are using redux for a simple to-do app, then its design principles are probably not as valuable.
It’s like thinking about time complexity for algorithms, at a small enough N, even slow algorithms can compete, but as you increase N, some algorithms become untenable.
- runawaybottle 6y agoYou are not the only one debugging large apps. How does the wider world of programming debug stuff without actions and reducers? It’s crazy how the Redux people either always appeal to authority (‘my app is bigger than yours’) or can’t say anything more than ‘I just like it’. And to play the rhetorical game, what happens when you have hundreds of thousands of lines of insane Redux code where you have lost all sense of the state tree and need to mentally cordon off one single piece of it to not go insane? Kind of like how libraries like this are already doing it. So here is my challenge to you. Spec out an app that you believe can only be solved with Redux at scale (or rather, highlight the areas of the app that absolutely benefit from Redux, but please provide as detailed a spec as you can if you have the time, or care for that matter). I’d love to hear about this incredible web app.
- qudat 6y agoThe reason is because the problems that surface at scale are difficult to illustrate in a comparison blog, which is the foundation for all the rants against redux. Redux is not complex, contrary to popular belief. The core code can be written in 100 LoC. The real downside to redux is not the boilerplate that is required to set it up or the number of concepts to learn, instead it’s how easy it is to do it incorrectly. The redux maintainers have spent the last few years not making changes to the core library, but figuring out conventions and helper libraries to make it more clear what you should (eg normalize state) and should not (put every piece of state) in your redux store. No offense but the spec exercise seems like a waste of both of our time. No amount of talking about an app can illustrate the code organization at scale.