The functional programming paradigm has been around for quite a long time. For various historical and cultural reasons, the imperative paradigm has been dominant in mainstream, commercial software development. Functional programming, while sometimes employed in industry, has more often been the focus of academic attention. ("Because there are few other kingdoms nearby, the Functional Kingdoms must look with disdain upon each other….")
That imbalance is changing. Functionalism is newly trendy and enterprises of every sort have taken notice. With the rise of well wrought functional or semi-functional languages (such as Clojure and Scala) for the Java virtual machine, there's now a lot of buzz in Java circles about how to integrate imperative and functional approaches to reap the benefits of both against the backdrop of a mature platform and huge ecosystem. (For this reason, I'll be talking about such things a lot in future posts!)
Via @graemerocher comes a link to the first of a four-part series (in the IBM developerWorks series) by Neal Ford of ThoughtWorks on this very topic. In "Functional thinking: Thinking functionally, Part 1", Ford explains the mental distance between (a) modeling the world as a bunch of chatty objects, each with its private, mutable state and access-regulated methods, and (b) modeling the world as a bunch of stateless, cleverly chained or nested static functions.
To help newcomers cross that distance, Ford steps gently through some conventional Java code and shows how a functional way of thinking would change it:
As I'll illustrate, writing code in a "functional" manner touches on design, trade-offs, different reusable building blocks, and a host of other insights. As much as possible, I'll try to show functional-programming concepts in Java (or close-to-Java languages) and move to other languages to demonstrate capabilities that don't yet exist in the Java language.
If you're new to functional language concepts and would like to learn the difference between an axe and a chainsaw, check it out!






