4 ms·
Not true at all! Coming from Java, notoriously OOP heavy idiomatically, or python, sprinkling in some functional programming is Fantastic(!). Despite all the FP
by kjeetgill 8y ago
Not true at all! Coming from Java, notoriously OOP heavy idiomatically, or python, sprinkling in some functional programming is Fantastic(!). Despite all the FP vs OOP hoopla I think they actually play fairly well together. Even OOP has moved to immutable records + localized behavior as the rule and fully mutable objects with side-effects are the exception.
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.
- macintux 8y agoYou 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.