8 ms·
> complex React/Angular applications, where invented complexity is the status quo and this kind of misdirection is simply what you have become desensitised to
by robertlagrant 6y ago
> complex React/Angular applications, where invented complexity is the status quo and this kind of misdirection is simply what you have become desensitised to
This. Redux is the worst for this.
"Compose your reducers, which magic a state object out of defaults, and split your switch statement across a zillion files, and isn't it amazing how it's just Javascript?" - feels like a direct quote from every Redux tutorial and blog post ever.
I yearn for "make your state an object, and have a big switch statement. Oh, and if that ever becomes unmanageable, only then think about reducers."
- ng12 6y agoThe second quote is what Redux actually is, the first is the result of massive amounts of cargo culting. It's actually why I don't mind Redux's boilerplate. It's punishment for using Redux when you don't have to.
- robertlagrant 6y agoWell, combineReducers etc are all in Redux.
- mrh0057 6y agoIt’s pretty odd right now that most languages are trying to add more ml features to classic oo and imperative languages. Design frameworks that are much easier to use in functional languages. Then try to make it work with imperative language or classic oo language and wonder why it seems to get add unnecessarily complexity as the app gets bigger. Seems like we are at a start of a transition period where we will move to more functional languages over the next 20 to 30 years. I wish a large company would design and modern ml and not try to make it backwards compatible with an existing runtime.
- valenterry 6y agoWhat are "ml" features? Do you mean FP features?
- philh 6y agoI take it they mean "features from ML". Which is indeed functional, but a specific style of functional. https://en.wikipedia.org/wiki/ML_(programming_language) https://en.wikipedia.org/wiki/ML_(programming_language)
- acemarke 6y agoHi, I'm a Redux maintainer. If you haven't looked at Redux recently, you should look again. "Modern Redux" code is drastically simpler than the Redux code you've probably seen before. In particular, our official Redux Toolkit package [0] and the React-Redux hooks API [1] make it much simpler to write Redux code, by auto-generating action creators, writing reducers as object lookup tables instead of switch statements, letting you write "mutating" immutable updates in reducers, and providing good defaults out of the box and utilities that handle common use cases. FWIW, we've just completely rewritten the official tutorials in our docs to show how much simpler "modern Redux" code is, as well as better explain the fundamentals and why many of these patterns exist: - The "Redux Essentials" tutorial [2] teaches "how to use Redux, the right way", by building a real-world app using Redux Toolkit - The "Redux Fundamentals" tutorial [3] teaches "how Redux works, from the bottom up", by showing how to write Redux code by hand and why standard usage patterns exist, and how Redux Toolkit simplifies those patterns In addition, we've added a "Style Guide" docs page [4] that lists our recommended patterns and best practices, which help you write Redux logic that is simpler, easier to understand, and easier to maintain. That includes things like "write Redux logic as single file 'slices'", "put as much logic as possible in reducers", "model actions as 'events', not 'setters'", and so on. We've gotten a lot of great feedback telling us that RTK and the docs improvements have really made it a lot easier for people to learn and use Redux effectively. [0] https://redux-toolkit.js.org https://redux-toolkit.js.org [1] https://react-redux.js.org/api/hooks https://react-redux.js.org/api/hooks [2] https://redux.js.org/tutorials/essentials/part-1-overview-concepts https://redux.js.org/tutorials/essentials/part-1-overview-co... [3] https://redux.js.org/tutorials/fundamentals/part-1-overview https://redux.js.org/tutorials/fundamentals/part-1-overview [4] https://redux.js.org/style-guide/style-guide https://redux.js.org/style-guide/style-guide
- chrismaltby 6y agoI can second that, I’ve just recently started migrating my open source application [0] to use Redux Toolkit and the hooks API (+Typescript) and it’s been a pleasure to use and MUCH less boilerplate than the previous implementation. Thanks for your efforts working on this! [0] https://github.com/chrismaltby/gb-studio/tree/v2beta https://github.com/chrismaltby/gb-studio/tree/v2beta