Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Redux, made for very large scale applications. Most companies shouldn't use redux at all, just as Dan Abramov said several times that you probably don't need it.

For unknown reasons most front-end developers don't wanna hear that and love to start with mega complexity and boilerplate where just a simple flux store or a library like 'unstated' would suffice. Anything leaner than redux is very welcome for the average companies web app imao.



> Redux, made for very large scale applications. Most companies shouldn't use redux at all, just as Dan Abramov said several times that you probably don't need it.

As per my own comments, I agree strongly.

> For unknown reasons most front-end developers don't wanna hear that and love to start with mega complexity and boilerplate where just a simple flux store or a library like 'unstated' would suffice.

Not unknown, no. Because FB promoted Flux like it was something magical and never seen before, talked about store without providing best practices or reference implementations, and so many store implementations came out at the same time. And most tutorials, not knowing exactly what to recommand to provide some state to your tiny app, started all to promote one store or another. So people though it was mandatory.

It's like with react tutorials.

When I teach react, I make sure people start by just dropping a script tag, and use createElement. No JSX. No webpack. Most of the page is even static HTML.

Only once they got the basics covered, I build on that up to abstractions, tooling, best practices, etc.

That's not what you read online. Online, people drop some magic lines and say "see how this todo list example is easy ?", then let you die here.


I agree with you in terms of learning React. Not sure I agree in terms of app size. Yes, there's some boilerplate associated with Redux. But it's pretty simple, and I find the "one way data flow" model really does simplify thinking about how state transitions work, in a way that is beneficial even for small apps.


Redux does come with boilerplate, but I don't agree that's it's complex. IMO it's one of the simplest ways of managing state. I find it's useful for things like user authentication details which are global-state that doesn't correspond to a specific part of the app. And even small apps tend to have this.


Unstated (last commit from Summer '18) seems unmaintained. Is there anything more current you would recommend?


Mobx. It's not small, but it is easier than redux.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: