6 ms·
>>time-travel debugging, hot module reloading, and simple and easy undo/redo capabilities These things are prime selling points of Redux and it's interesting t
by forgottenacc57 9y ago
>>time-travel debugging, hot module reloading, and simple and easy undo/redo capabilities
These things are prime selling points of Redux and it's interesting that they are simply unimportant bells and whistles not worth the massive increase in complexity and cognitive load that Redux brings to ReactJS applications. Use Redux and you have to write a lot more code, really for no good purpose when in most cases you can just store a (HERESY!) global variable and get straight on with the job without twisting your mind around actions and all the other Redux guff.
Redux is an anti pattern.
This article also breathlessly praises webpack, which is a massively complex and configuration heavy JavaScript tool and one of the prime culprits responsible for the JavaScript build tool ecosystem being so damn complex. Webpack needs to go the way if it's predecessors and he replaced with something simple.
- onion2k 9y agoI don't know enough about React to say whether or not I like Redux, but I've written enough Angular code to know that Angular's lack of a good state manager is a problem. A lot of Angular apps end up storing an object in $rootScope that's treated like a global state, and that leads to weird side effects and bugs if you're not careful. Something like Vuex would be be a great addition to Angular.
- Sujan 9y ago> ... $rootScope ... Didn't you write AngularJS code then? As the article riffs about at length, Angular (Angular 2+) and AngularJS (Angular 1) are fundamentally different.
- forgottenacc57 9y agoMaybe I'm doing it wrong but when I (rarely) need state between components I just plop it into a global variable, of which there only ends up being s handful, and it's never been a problem. When I tried to use Redux first it burned my brain trying to grasp its architecture and how to write the various bits of code it needed, all replaceable with this.app.globals.foo=42
- shadow_banned 9y agoYour really a fan of the this.app.globald.foo = 42 eh?
- bdcravens 9y agoLike @ngrx/store? https://github.com/ngrx/store https://github.com/ngrx/store
- hamersmith 9y agoIn Angular 1 I have always used Services for storing state and sharing it between components. In the latest versions of Angular we have started using angular-redux.
- lhnz 9y agoRedux 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 ago
- deleted 9y ago[deleted]
- jbreckmckye 9y agoI have always felt that the Redux projects I've seen are extremely bureaucratic. I don't know if they are outliers, if they are just 'Redux done wrong', but typically I find that every piece of behaviour is split out across multiple layers, generally in different files, to the point it is very difficult to reason what a particular button or event will actually _do_. I notice also that in these projects, every pull request takes many files. Whereas in an Angular 1 project there would be an update to a template and a controller, now each PR comprise updates to a reducer, a container, a component, a saga, a 'lifecycle component', an action creator, and a props schema. As for Webpack, I don't understand the popularity. I find configuring it awkward, not least because it relies on third-party plugins of highly variable quality. Most plugins are very poorly documented, and those that aren't invariably seem to have big fat DEPRECATED notices. It seems that any plugin that makes enough assumptions to be useful is inevitably chucked in favour of something that is totally configurable but by default equally useless. YMMV. At least with Gulp, I could step through a build process and write a little bridging code when two plugins stepped on each others toes. Webpack doesn't give me any such chances.
- mmargerum 9y agoUndo / redo is a nice to have? If you are building spa web front ends the right way these are essential. Using modals with OK/Cancel buttons to confirm actions is not ok in a web app. It should work more like you are editing a document in a structured way hence undo becomes a requirement. Trying to undo in a web app where state is stored inside components becomes a nightmare. Redux makes this a heck of a lot easier.
- deleted 9y ago[deleted]