Languages like OCaml, F#, Lisp etc. are advertised as primarily functional languages however they also have object oriented features (either built in eg. OCaml & F#) or through well supported libraries (eg. CLOS).
From a pragmatic perspective, are there actual use cases where having such object oriented features are beneficial ?
The only use case that I have been able to truly appreciate is compatibility with other object oriented languages, especially when they share the same underlying runtime, as is the case with F#.
I'm not sure about the very details of both patterns but there's some clues we may follow.
Functional programming may solve all problem, but unlikely to solve all in easy ways. And object oriented programming is very different and some parts of it may help making things that is hard in functional programming easier, read about the expression problem here: eli.thegreenplace.net/2016/the-expression-problem…
Samuel Oloruntoba
Java is to JavaScript what Car is to Carpet.
Why was OOP created?
Most people will say reusability, but function's already got that covered. Classes describe objects and this is something that is very useful. Imagine this, you are building a game, and each character has a unique punchline or weapon, a class can accurately describe this object. Sure this could also be achieved using functions, but classes solve this problem in a neater and more expressive manner.
Features of OOP:
OOP provides a lot of features that makes it a robust solution. Below are just a few of those features.
number_of_limbs()on an object, which will work whether the object is of classAnimalor classDog.TL;DR
Yes, there are benefits. OOP always has its benefits. Sure there are languages that are more on the functional side, that doesn't mean that they can not have a touch of OOP. OOP done right is a really beautiful thing.