News for hackers. Stuff that matters.
Re:Best Practices for Using Functional Programming in Python by kjeetgill on Wednesday December 05, 2018 @06:06PM (#18613669)
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.

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.