3 ms·
I think FP works okay, but at the appropriate scale. Tell Above, and Ask Below. https://news.ycombinator.com/item?id=3876136 https://news.ycombinator.com/item
by michaelfeathers 11y ago
I think FP works okay, but at the appropriate scale.
Tell Above, and Ask Below.
https://news.ycombinator.com/item?id=3876136 https://news.ycombinator.com/item?id=3876136
When functional code gets unwieldy, it's probably time to place an object layer above it. You see the model in Erlang (where processes act as objects) and the messsaging middleware of many IT systems.
- kenbot 11y agoIt's time for this terrible "Objects in the large, functions in the small" idea to be put to bed. FP can do side-effects, asynchrony etc just fine, it's just about controlling them so you can still reason about your program and compose its elements easily. Kay-style message-sending object graphs are neither modular nor composable; state & effects leak transitively by observation, and they cannot be recombined in self-similar patterns. Local reasoning is impossible. We can talk about specific situations where say, Actors models might have pros and cons, but a blanket recommendation that "it's probably time for an object layer" is rubbish. Why not design for composability and modularity top to bottom?