Live data from Hacker News

How Redux Works: A Counter-Example

daveceddia.com

1–10 of 84 posts

Re: How Redux Works: A Counter-Example

#3
post #2

It is interesting how people have the idea that react === Redux/flux. Where in fact Redux is unopinionated and works with other libraries/frameworks just fine.

How often do you see redux used with anything other than react? Or are you just talking about redux working with react alternatives like preact/inferno, etc?

You're not wrong, but practically 99% of people pair it with react.

Re: How Redux Works: A Counter-Example

#4
There is a certain paradox with teaching something like Redux, in that it's designed to make complex systems easy to understand and manageable. Yet when trying to demonstrate with a simple example, it appears hugely over complex and unnecessary.

I think a pre-requisite to learning something like Redux (or any micro-architecture) is to first try building something without it. Once you understand the pains of undisciplined, organically designed, spaghetti applications, the cynicism is replaced by excitement over how this will improve your job/life/application.

Re: How Redux Works: A Counter-Example

#5
post #2

It is interesting how people have the idea that react === Redux/flux. Where in fact Redux is unopinionated and works with other libraries/frameworks just fine.

Yeah it really is. I'm not sure where that comes from. Maybe it has something to do with the climate when React rose to popularity, where all the competing alternatives were "frameworks," and so people were in that mindset when they approached React?

In any case, it's led to a ton of confusion in the community, especially for newcomers.

Re: How Redux Works: A Counter-Example

#6
post #3
post #2

It is interesting how people have the idea that react === Redux/flux. Where in fact Redux is unopinionated and works with other libraries/frameworks just fine.

How often do you see redux used with anything other than react? Or are you just talking about redux working with react alternatives like preact/inferno, etc? You're not wrong, but practically 99% of people pair it with react.

It seems to be quite common in angular, even if used indirectly or via inspired libraries.

https://github.com/search?utf8=%E2%9C%93&q=angular+redux&typ...

Re: How Redux Works: A Counter-Example

#7
post #4

There is a certain paradox with teaching something like Redux, in that it's designed to make complex systems easy to understand and manageable. Yet when trying to demonstrate with a simple example, it appears hugely over complex and unnecessary. I think a pre-requisite to learning something like Redux (or any micro-architecture) is to first try building something without it. Once you understand the pains of undiscipl…

This paradox I think is what turns people off Redux when they first learn it. "All this code... for what benefit?" Of course it's total overkill for something like a counter, or a todo list, but it's tough to teach an introduction to something by starting with "here's a huge enterprise app, let's dive in" :)

I tried to call this out in the article to make sure people are aware that improving simple Counter examples is not what Redux is really meant for.

I'm considering putting together a larger course/book that does just what you say - build up a React app using plain state until it becomes painful, and then refactor it to add Redux. My question right now is, how far should I go? Do I walk through building the entire app with state (and push through the complexity), or do I give up at the first indication that Redux would make things easier?

Re: How Redux Works: A Counter-Example

#8
post #4

There is a certain paradox with teaching something like Redux, in that it's designed to make complex systems easy to understand and manageable. Yet when trying to demonstrate with a simple example, it appears hugely over complex and unnecessary. I think a pre-requisite to learning something like Redux (or any micro-architecture) is to first try building something without it. Once you understand the pains of undiscipl…

This is exactly what happened to me and I'm glad I did it. My intro to programming was a nightmare jquery app. Then a slightly better Backbone app with too many Globals. Then an over engineered Sails app. And now a collection of React + Redux apps, multiple years old, each with increasing levels of maintainability.

I'm hesitant to see new programmers avoiding a "learn the hard way" project. Without it, there's so much they might never grok.

Re: How Redux Works: A Counter-Example

#9
post #4

There is a certain paradox with teaching something like Redux, in that it's designed to make complex systems easy to understand and manageable. Yet when trying to demonstrate with a simple example, it appears hugely over complex and unnecessary. I think a pre-requisite to learning something like Redux (or any micro-architecture) is to first try building something without it. Once you understand the pains of undiscipl…

Just went through this myself, and that was exactly my experience. Really glad I spent time working with React so I knew what Redux would be great for before I tried to learn it.

Re: How Redux Works: A Counter-Example

#10
post #4

There is a certain paradox with teaching something like Redux, in that it's designed to make complex systems easy to understand and manageable. Yet when trying to demonstrate with a simple example, it appears hugely over complex and unnecessary. I think a pre-requisite to learning something like Redux (or any micro-architecture) is to first try building something without it. Once you understand the pains of undiscipl…

> Once you understand the pains of undisciplined, organically designed, spaghetti applications, the cynicism is replaced by excitement over how this will improve your job/life/application.

Beautifully said. The same goes for schema-less data models. The full appreciation of foreign keys, data type validation, and check constraints doesn't kick in until you try incrementally changing a NoSQL spaghetti app.

Post reply on HN