6 ms·
Redux was such a mental overhead for me when I started out with it. The amount of boilerplate code that I had to write for the project I worked on was very frus
by Karupan 7y ago
Redux was such a mental overhead for me when I started out with it. The amount of boilerplate code that I had to write for the project I worked on was very frustrating. What helped me truly understand the concept was Elm.
These days I ask junior devs to learn Elm for a few days. We still use Redux, I will not choose it for new projects.
- acemarke 7y agoPlease try out our new official Redux Toolkit package, which will help simplify your Redux logic considerably: https://redux-toolkit.js.org https://redux-toolkit.js.org
- fastball 7y agoor Rematch. http://rematch.github.io/ http://rematch.github.io/
- banachtarski 7y agoRight see, this is what all redux proponents advocate. Every redux project I see is chock-ful of "extras" to make redux workable, and this changes from season to season. If this isn't an architectural smell, I don't know what is.
- bauerd 7y agoNot sure why different libraries would be an architectural smell. Not only Redux projects vary greatly in what they bolt onto their state management. I've used Redux successfully on its own. The dataflow pattern it mandates is important, not the concrete implementation.
- egeozcan 7y agoYou can use the built-in IoC controller or Autofac or ServiceStack or whatever you want along with ASP.NET Core projects. I don't think it is architectural smell at all. Also I find classifying people as Redux-proponents funny. It's not a camp, or at least not supposed to be one.
- fastball 7y agoRedux itself is a very simple concept. There is so much boilerplate because the actual library makes very few opinionated decisions. The issue is that people are looking for something comprehensive from what is supposed to be a minimal base library which you can use to build a huge variety of other things.
- city41 7y agoThat link is a 404, looks like the site is here: https://rematch.github.io/rematch/ https://rematch.github.io/rematch/
- Karupan 7y agoThanks, will check it out. Unfortunately, it only adds to the dependency hell in the front-end stack. We already use quite a few add-ons to make Redux+Sagas tolerable. My personal take on the whole JS + Redux stack is that Redux tries to bring order to a language which fundamentally doesn't support certain traits - immutability, custom types, etc. While commendable, it will always just be a band-aid. I wonder if it's time to move to more purpose built languages which do not have these shortcomings (Elm, PureScript, etc) That said, I'm sure Redux and friends will continue to be used in the years to come.
- egeozcan 7y agoOTOH, any sufficiently complicated React app contains an ad hoc, informally-specified, bug-ridden, slow implementation of half of Redux.
- hootbootscoot 7y agoOTOOH, react et al are just attempts to make the asynch web synchronous. Request/response cycle returns a resource, including embedded resources, and we get over it and move on in life. Now, how on earth a folder-index-sharing protocol for hyperlinking became the planets default UI surface for everything ever, that's another ball of wax to fry another day, killed with the same stone as the mythical 2 birds, etc.
- freehunter 7y agoI see the Redux devs defending their tool in every comment thread around Redux and I have to say to them: it's not your fault and there's not a lot you can do to fix it by yourselves. The problem is every tutorial and training and boot camp and video I've ever seen around Redux treats Redux like heavyweight boilerplate and teaches you that you need five files with Redux where you only needed one with plain React and every function you add needs to touch all five of those files, including a file that only exists to write the name of the function you've added. What I hear from the Redux devs does not in any way line up with what I heard from Brad Traversy or Stephen Grider, who have taught tens (hundreds?) of thousands of people on Udemy that the simplest React projects must be used with Redux and Redux turns beautiful React code into dotcom-era Enterprise Java.
- acemarke 7y agoYeah, unfortunately once something gets a large community, it takes on a life of its own. Part of the issue is that the Redux docs _do_ show many of these patterns (`const ADD_TODO = "ADD_TODO"`, separate files and folders for constants / actions / reducers, etc). Dan has said several times that he didn't expect folks to literally mimic everything that was shown in the docs, but tbh that's what people do. He's also said he wishes he'd emphasized teaching it in some different ways. We're doing everything we can to try to teach better practices and patterns now, but that can't magically change the gazillions of existing tutorials and codebases that are out there.
- JMTQp8lwXL 7y ago> didn't expect folks to literally mimic everything that was shown in the docs Isn't that the point of documentation? To give you a reasonable, suggested way of incorporating a library into an existing project? This is almost saying, "the docs were wrong and everyone learned the wrong thing". I don't think you can blame package users for that. People reference documentation to know what to do, and also what to avoid, when using a new library.
- acemarke 7y ago
- the_gipsy 7y agoIt's such a shame that redux missed the equivalent of returning a Cmd in reducers. It would have made everything much simpler and reasonable, especially the boilerplate.