Re:Best Practices for Using Functional Programming in Python
by macintux on Wednesday December 05, 2018 @07:06PM
(#18614085)
You can get those OOP benefits using Erlang.
I’m not saying it’s bad to add FP bits to other languages. I just haven’t seen the same benefits as when I know what a called library/module can and can’t do with my data.
FP is great at the high-level for orchestrating workflows and in the lower-level processing/transforming/aggregating over streams of immutable records. OOP is great at the high-level for independent communicating services/life-cycles and fine-tuned memory bound algorithms and needing state machines lower down.
You generally know what parts of your code mutate and what don't well enough to get the nice side-effect free usage from your functional parts.
Someone smarter than me once said: OOP? FP? It's really all just about being principled about state. A closure is just an object with one function.