5 ms·
Redux DevTools is immensely useful. Being able to see all of your state for your application and clearly know exactly which action caused some invalid state is
by lhnz 9y ago
Redux DevTools is immensely useful. Being able to see all of your state for your application and clearly know exactly which action caused some invalid state is great. It also enables QA to export the actions which caused some invalid state rather than needing to laboriously and perhaps inaccurately describe a series of steps.
Redux itself can cause people to write quite a bit of boilerplate, however it massively improves testability, and if you use the correct abstractions and debugging techniques around it definitely decreases cognitive load. The problem is that it's possible for people to misunderstand how it should be used and shoot themselves in the foot.
I agree that Webpack is complex, however it is much more manageable than a series of folders containing obtuse Grunt/Gulp tasks, ad-hoc scripts and wrapper plugins.
- forgottenacc57 9y agoI think it says it all the Redux comes with its own set of tools to see WTF is going on inside it. None of it is necessary. Your code base will thank you as will the gods of software simplicity when you rip out all the Redux and Redux tooling and write this.app.globals.myvar='selected' Honestly, think about all the time you spend writing not React code but Redux code - it's crazy and totally wasted time and effort.
- simon83 9y ago> rip out all the Redux and Redux tooling and write this.app.globals.myvar='selected' It's obvious you have no idea what you are talking about.
- forgottenacc57 9y agoIt's lazy to make an ad hominem attack. I write big feature rich react apps without Redux and never hit any situation where I sit around going "damn I need time travel and hot loading and and extra thousand lines of Redux code to remember state."
- simon83 9y agoI'm sorry, I read your comments, and I could write a 5000 word essay, trying to show you that your perception of Redux is totally wrong, but I'm not going to bother, because I'm sure this won't change your mind in the slightest. > extra thousand lines of Redux code to remember state Sorry for yet another ad hominem attack, but this just shows that you are doing something wrong. Yes, Redux requires some amount boilerplate code, but if you need thousands of additional lines of code for state management, then you are lacking code abstraction skills.
- forgottenacc57 9y agoReactjs is dead simple until you introduce Redux. I think applications can be architected that don't need it.
- eropple 9y agoIsolation of state and transactional, external mutation of sate demonstrate correctness in exchange for (minor) boilerplate that, frankly, only looks complicated (and never should look complex, it's trivial) until you've actually read the code. You can build an application without functional state management. Of course you can. But, frankly, you can't demonstrate conclusively that you know it's correct or where incorrectness stems from. Which strikes me as something of a problem, and one that does violence to the verb "architect".
- jbreckmckye 9y ago> Yes, Redux requires some amount boilerplate code I think you're underplaying this. The Redux apps I've seen thread data through a great many layers - action creators, actions, reducers, sagas, schemas - and I think it's fair to say that compared to other projects, Redux apps have very long 'chains of operation' (I want to avoid value-laden terms like 'structure' or 'bureaucracy'). Is it worth it? I'm not sure. The Redux apps I've seen have used this 'highly formalized' approach to handle quite simple interfaces. Maybe I'd have different feelings if I was writing something bigger? It's not that I hate Redux, or think it out and out 'sucks'; but I've worked on a lot of projects and first Redux ones I've worked on seem unusually difficult to reason about, and a few of my colleagues share my feelings. We feel like it is hard to reason exactly what an event or command exactly 'does', and that the diffusion of behaviour across files plays a part in that.
- lhnz 9y agothis.app.globals.myvar='selected' How do you find out which part of your code set your global mutable state object (e.g. `this.app.globals[propertyName] = stateType` or `$globals.myvar = 'selected'` or `window.app.globals['myvar'] = 'selectedd'`)? What if two or more bits of logic try to set this variable at the same time and it ends up with a value that you didn't expect? How will you control that `myvar` can only be set to particular values dependent on other state? How will a QA engineer demonstrate to you that it was this state change which broke your application? Your 'solution' is a bad practice, and Redux is a huge improvement over it.
- forgottenacc57 9y agoIt's such a dead simple solution that it's never been a problem. Certainly doesn't warrant replacing with all the code and complexity of Redux, which introduces its own demand for testing and QA, and I would argue offsets its own value due to its complexity. In software development simple = understandable and reliable.
- lhnz 9y agoBut I just demonstrated that it's not understandable or reliable. You are proposing a solution where any badly written code can affect your global state in a way that you can't control for, and in a way that you will not be able to search for. Eventually you are going to get bugs, and you are going to have a hard time tracking them down for the reasons I've described. It might be okay if you work on small projects without many team members, but in larger projects it's extremely annoying to have these kinds of issues.
- forgottenacc57 9y agoI wonder if it's maybe the architecture of my application that means I don't need to store much state, and I only store state that doesn't seem to subject my app to the issues you describe. When I hear about these apps with a heavy reliance on client side state I wonder what the heck they are doing... if you've got so much complex data/logic does it really belong in client state? I'd see it as a problem and try to architect it out, or store it somewhere.
- nickserv 9y agoWhether it's in PHP, Python or JS, this type of anti-pattern is considered as such for good reason. I don't know how many days (months?) of my life have been wasted debugging "why is this variable changing, and from where?!?". Accompanied of course by much cursing the developer to the n-th generation who thought it would be a good idea to use a global variable.
- bdcravens 9y ago>> Redux DevTools is immensely useful If you use @ngrx/store, they can be used with Angular2+ as well. https://github.com/ngrx/store-devtools https://github.com/ngrx/store-devtools