There’s no question that interest in functional programming (or FP) has grown significantly in recent years. However, it is not the functional renaissance that FP advocates have been claiming. Let’s look at the evidence…
FP languages in general have not become popular, according to all the major language rankings. At TIOBE, none of the top 20 languages are FP. At Redmonk, Haskell is at #16 and Clojure at #20; no other top 20 language is FP. At IEEE Spectrum, we don’t see a FP language until Haskell at #25. At PYPL, Haskell is at #20. In the StackOverflow Developer Survey of 2016, none of the top 12 Most Popular Technologies are FP. So where are all these FP languages???
Scala is not a FP language; it’s multi-paradigm with support for both FP and OOP. Scala has attained a measure of popularity by being a “better Java,” not by being FP.
While nearly all of the major languages (Java, Python, C#, C++, PHP, Ruby) have added first-class functions and closures to their feature set, no one uses these languages in a heavily FP manner. Lambdas exist as a convenience for those who care to write some FP code.
How many colleges and universities even teach FP languages? MIT have taught programming to freshmen using Scheme (and SICP) for decades, but otherwise evidence of FP in CS curricula is scarce.
In fact, functional programming is generally harder for people to wrap their heads around. It’s hard for them to relate to the notion that everything in their world can be modelled as “functions.” What the heck is a function??? A function is a relation between a set of inputs and a set of permissible outputs with the property that each input produces exactly one output. Okay, I see…not.
It’s far more intuitive for people to model their world as “objects.” Everybody knows what an object is. You can look at it, touch it, point to it to show someone else. A kindergarten child knows what an object is.
Despite the benefits of functional programming, it is not the panacea that FP fans would have you believe. FP and OOP are merely tools that have their appropriate uses. FP is not a universal solution. It is also not free from downsides, for example, see this and this and this.
It’s worth noting that Smalltalk, despite being a “pure” object-oriented language, has always had lambdas. Lambdas, in combination with objects, are one of the reasons Smalltalk is such a powerful and productive language. Yes, Smalltalk is not a FP language in the usual sense, but there is more than one way to skin the “functional programming” cat. Meow.
Hacker Noon is how hackers start their afternoons. We’re a part of the @AMI family. We are now accepting submissions and happy to discuss advertising & sponsorship opportunities.
If you enjoyed this story, we recommend reading our latest tech stories and trending tech stories. Until next time, don’t take the realities of the world for granted!