Functional Programming for Java Developers

Functional Programming for Java Developers: A Short Introduction explains the principles of Functional Programming in a straightforward and pragmatic style, with code examples written in Java so the Java developer can see how to apply those ideas without switching to a functional language.

As a short introduction, the book doesn't cover every aspect of this rich field, but it tries to convey the most important ideas and why Functional Programming is often a better fit than Object-Oriented Programming for the problems of our time.

I cite these factors in the book for why I need Functional Programming:

  • I Have to Be Good at Writing Concurrent Programs: All of us must know how to write robust code that scales horizontally.
  • Most Programs Are Just Data Management Problems: Big data requires very efficient management of resources. Those efficiencies also benefit "small data" projects. Over-reliance on object-relational mapping and other forms of object middleware lead to code bloat, poor performance, and lower agility. We should remember, What's the simplest thing that could possibly work? We shouldn't assume that our domain object models need to be faithfully implemented in code.
  • Functional Programming Is More Modular: Functional Programming moves the abstraction layers lower, to core data structures and combinator functions. The modularity and reusability of functional code is better than similar object-oriented code. Because objects are so free to expose abstractions any way they want, they are less reusable and composable, which is a paradox.
  • I Have to Work Faster and Faster: Functional Programming keeps my code concise, by minimizing unnecessary and "one-off" implementation constructs, and it keeps my code logically correct. These qualities, in turn, keep me more agile over the life of the project as requirements change and features evolve.
  • Functional Programming Is a Return to Simplicity: Functional Programming isn't simple, but it represents a return to simplicity; the goal of minimizing implementation size and complexity by rethinking our ideas about design patterns and idioms.