This is a short review of the book Functional Programming for Java Developers.
With FP getting a lot of attention lately more and more Java developers want to learn about it. While Java is not really a functional language many ideas from FP can also be used in Java, although not always a elegantly as in languages like Scala or Clojure.
In July 2011 O’Reilly published Functional Programming for Java Developers. It is written by Dean Wampler who is also a coauthor of the wonderful Programming Scala book (also available online).
This short new book provides the basics of FP for Java developers who do not yet know much about FP.
The author explains why FP is important today and why it makes sense to learn it. He explains the basics of immutable types and shows some of the common functions found in functional languages like map, foldLeft, filter, etc. The implementations are done in Java and are easy to follow. It is clear from the code and the explanations that the author really knows his stuff.
An interesting chapter explains some new concurrency ideas like actors and STM (software transactional memory). Those things are not restricted to functional programming but languages like Erlang, Haskell or Scala support some or all of those new ideas in the language itself or as libraries.
The most important thing to take from this book are the ideas. Of course it is more convenient to use Scala for FP than Java (although this will get better with Java 8), but that doesn’t mean you can’t do it with Java.
Ideas are always more important than a language. If you understand a concept in one language, you will normally be ably to apply it in another even if it may be more work in one than the other.
After reading this book, I think you will have a good basic understanding of the advantages and ideas of FP.
At the end of the book the author gives a lot of links to interesting websites, other languages and frameworks (including functional programming libraries for Java!).
What’s not to like?
Given to the shortness of the book sometimes the reader wishes for a little more details but the idea behind the book is to be short, so it is inevitable that not everything can be explained in great details.
I would like to see an online supplement where the code examples from the book are also implemented in Scala and Clojure so the reader can see how much easier it is in those languages.
For the relatively low price (I paid a little less than 12 Euros) I think this is a great short book for every Java developer who is new to FP and want’s to see what it is all about and how to get starting using Java.
Highly recommended!
I recommend the ebook. It is just a short book which can easily be read on a computer.
After reading this book, make sure to follow the authors advice and look at the resources for further learning.
I personally recommend learning Scala as it combines the power of OOP and FP. I also recommend learning Haskell as it is a pure functional language (Scala, of course is not). I just started playing with Haskell and and will take some time to get your mind around it but it will definitely be worth it.
Print book from amazon.com:
Kindle book from amazon.com:
Markus,
Thanks for the kind review. I’m glad you liked the book. Also, I’m glad you appreciate the fact that I had to omit a lot of material to keep it short
Dean Wampler