Ask HN: Relationship between OO and functional programming?
This is a really interesting question and much work has been done.<p>For a long time, lambda-calculus has been seen by a lot of programming
language researchers as the foundation of programming to which every
other paradigm has to be reduced. This research tradition produced
much work on encoding object orientation (whether class-based or
object based) into lambda-calculus. Ideally such encodings should be
sound and complete. That has proven difficult. In parallel, functional
languages acquired OO extensions. The first serious implementation to
make this (sort of) work was OCaml.
Arguably, all that work wasn&#x27;t quite convincing. Eventually, it became
clear that lambda-calculus isn&#x27;t the basis of all other programming
paradigms. Instead people tried the reverse: encoding lambda-calculus into
object-orientation.<p>Scala really nails this, and validates your intuition that there isn&#x27;t a dichotomy. Instead FP is a special case of OO.<p>If you want to understand the relationship between OO and FP there is
no better way at this point to learn Scala and study how
lambda-calculus (both at program and type level) is encoded into
class-based object orientation.