oopfunctional-programmingparadigms

Functional programming vs Object Oriented programming


I've been mainly exposed to OO programming so far and am looking forward to learning a functional language. My questions are:


Solution

  • When do you choose functional programming over object oriented?

    When you anticipate a different kind of software evolution:

    When evolution goes the wrong way, you have problems:

    This problem has been well known for many years; in 1998, Phil Wadler dubbed it the "expression problem". Although some researchers think that the expression problem can be addressed with such language features as mixins, a widely accepted solution has yet to hit the mainstream.

    What are the typical problem definitions where functional programming is a better choice?

    Functional languages excel at manipulating symbolic data in tree form. A favorite example is compilers, where source and intermediate languages change seldom (mostly the same things), but compiler writers are always adding new translations and code improvements or optimizations (new operations on things). Compilation and translation more generally are "killer apps" for functional languages.