DEV Community

klappleseed
klappleseed

Posted on

Redux is like "everything a global variable"?

After using Redux for a while, it just seems like Redux is saying "Everything will be a global variable", and we send messages or events (action objects) to alter them! That's our paradigm."

Imagine, now, if you write any JavaScript program, Ruby program, Python, Java, C++, and people tell you, "we make everything a global variable and now we send messages to alter them, ok?"

That's a big pool of variables and it can be a total mess. I still remember I wrote Apple Basic program, and then I learned Pascal, and I thought, "Local Variables", "Self contained", "Encapsulated", "Not contaminate the global scope" -- these are so cool and these is one of the coolest invention of programming. So Redux is taking that away.

Often I go into a project, and it is selectors after selectors, and then the tons of createSelector() to merge selectors into more selectors, and the tons of reducers. I am not even sure what I am programming.

Top comments (1)

Collapse
 
psiho profile image
Mirko Vukušić • Edited

Had a same feeling. Tried MobX instead of Redux. Loved it and never went back.