3 ms·
I don't get that, of course it's not functional code in the same way it could be with Haskell or some other functional language, but the main benefits and the w
by nathias 5y ago
I don't get that, of course it's not functional code in the same way it could be with Haskell or some other functional language, but the main benefits and the way of thinking can be done with JS, and its a much better part of JS than the prototypal inheritance with class sugar syntax part.
The main point of fuctional paradigm in engineering is composition over inheritance. Hooks give us that, and a way to escape classes (and people who really want to write JS like Java).
- horsawlarway 5y ago> The main point of fuctional paradigm in engineering is composition over inheritance This isn't my goal with functional programming. My goal is to minimize side effects. I want code that is repeatable, consistent, and easy to test. I want front end code that's as close to a pure projection of state->DOM as I can get, because that makes all sorts of problems simply vanish (And the less state, the better!). I like hooks, mostly - but lets not pretend here... they're only functional if you don't look at the man behind the curtain.