Welcome to the main community in programming.dev! Feel free to post anything relating to programming here!
Cross posting is strongly encouraged in the instance. If you feel your post or another person’s post makes sense in another community cross post into it.
Hope you enjoy the instance!
Follow the wormhole through a path of communities !webdev@programming.dev
Right yeah.
Many OO languages lean into FP heavily as well.
There are really very few OO languages that really lean FP.
The essence of FP is working with pure functions that simply map their input to their outputs without mutating anything.
To do that, you need immutability by default, or at least easy immutability. Very few OO languages do that in their standard libraries. Scala comes to mind as one of the few exceptions. There’s also a bunch of FP languages that bolted an object system into them, like Ocaml and F#.
There’s a lot of OO languages that take some features like closures from FP languages, but it’s typically a royal pain to actually do anything functionally in those languages. Java and python come to mind here. Javascript used to be a huge pain, but with spread syntax it’s gone down to only moderately painful.
And while you can definitely do FP + OO, to be honest there’s a bunch of similar but distinct language features in FP languages that I kinda prefer instead.