Functional Programming: A Foregone Conclusion in the Enterprise
I’m an enterprise Java architect who’s been using functional programming techniques for the past several years. The majority of my experience has been with Scala and Akka with the occasional use of Lisp and Standard ML. I thought I would step back and offer an encouraging perspective to other Java veterans for when they realize that functional programming is a necessary paradigm for the future. For many veterans, I’ll simply remind them that they have already weathered the adoption of a major programming paradigm: object-oriented.
Object-oriented techniques are a foregone conclusion in this day and age of programming. But it wasn’t always so. There was a time when meetings were consumed with discussions of OO methodologies and the virtues of inheritance, composition, encapsulation, and polymorphism. I look back on that period of adoption as a necessary purification by fire. Embedded in all the chaos were some great OO techniques that needed to find their place in mainstream development. I think it is safe to say that the greatest contribution of OO technology is the ability to reduce complexity by creating meaningful abstractions over problem domains, which was always the promise of OO. But again, it took a while to realize the promise.
Like object-oriented, functional programming techniques will soon be a foregone conclusion. We are currently coming to terms with the notions of immutability, algebraic techniques, monads, actors, and reactive programming. At the core of this cacophony of ideas and terms is once again a promise of reducing complexity. Whereas object-oriented helped us reorganize our systems into meaningful structures of data and procedures, the functional promise is that we can reorganize our systems into parallel systems of enormous scale that “flow” together reliably. Taming the complexity of enormous scale is an absolute requirement before enterprise architectures can fully capitalize on the economics of multi-core processors, virtualization, and the cloud.
Finally, I would like to say that functional programming is in addition to object-oriented, and it is in this light that I can say that my experience in Scala and Akka has been rewarding. Sure, there are bumps in the road and there is certainly a learning curve, but that’s because learning is in the way of productivity. The best thing that any programmer can do is roll up his sleeves and dive in. The learning curve isn’t the language, it’s the new levels of abstraction that must be mastered in order to build reliable systems for tomorrow. Your hard work will be rewarded.