▲ | potamic 10 hours ago | |
It may be effective by sheer force of adoption, but it's not well designed at all. It has never been through all its iterations, with each one imposing a new programming model on its users and I predict what we have today will not be the last! It started simple and sound idea but had its quirkiness with shouldUpdate, didReceive, willUnmount. But that wasn't enough, to write decent applications, you need to do unidirectional flow. You can do that, all you need is actions, action creators and dispatchers! Now you have all this bloat that eventually leads to reflux. While you're tearing your head screaming "What the flux", redux comes along and says hey you know what, if you just write a giant switch statement, you don't need dispatchers. And everybody liked not having to read about dispatchers, so redux was here to say. If it gave more problems you can just create a toolkit around it. Besides, it claimed to be functional. Surely that means it works, right? Now you could rub shoulders with those cool clojure kids who seem to be getting all those high paying jobs. But the cool clojure kids are not impressed. They say, class is something you are, not something you write. So you hang your head in shame and promise to never write classes again. While you're untangling yourself from this mixin mess you got mixed up with, an epiphany hits you. If you can emulate a class using functions, then you don't have to write classes again! And so you finally get around to ridding yourself of classes. Sure it means you have to write more functions, and nested functions and wrap all your functions and shove the state away somewhere you can't see, but it makes everything functional, which means it works. Except for handling exceptions globally, you'll need to use classes for that. And by the way, don't worry about unidirectionality. Everything is asynchronous now. |