Java 8 Lambdas: Pragmatic Functional Programming

Richard Warburton

Language: English

Published: Apr 7, 2014

leido:

Description:

If you’re a developer with core Java SE skills, this hands-on book takes you through the language changes in Java 8 triggered by the addition of lambda expressions. You’ll learn through code examples, exercises, and fluid explanations how these anonymous functions will help you write simple, clean, library-level code that solves business problems.

Lambda expressions are a fairly simple change to Java, and the first part of the book shows you how to use them properly. Later chapters show you how lambda functions help you improve performance with parallelism, write simpler concurrent code, and model your domain more accurately, including building better DSLs.

  • Use exercises in each chapter to help you master lambda expressions in Java 8 quickly
  • Explore streams, advanced collections, and other Java 8 library improvements
  • Leverage multicore CPUs and improve performance with data parallelism
  • Use techniques to “lambdify” your existing codebase or library code
  • Learn practical solutions for lambda expression unit testing and debugging
  • Implement SOLID principles of object-oriented programming with lambdas
  • Write concurrent applications that efficiently perform message passing and non-blocking I/O

Amazon.com Review

Q&A with Richard Warburton, author of "Java 8 Lambdas"

Q. Tell us why your book is important right now?

Java 8 is a step change in terms of the development of the Java platform. It’s not just a new version with slightly improved libraries and a few more convenience functions. It introduces Java developers to a much more functional style of programming. By and large this is for the good. There are lots of things to help developers in Java 8 both in terms of productivity and writing more efficient code but it does mean that you need to learn a bit more. A few idioms and concepts can really help clean up code quite a lot.

Q. What do you hope readers will walk away with?

A whole load of ways to write simpler, cleaner, faster code. I think that's the most important thing that matters when reading a new programming book. There are a lot of concepts and idioms that people need to get used to and understand but the really important stuff is being able to apply it in a practical setting.

Q. What's the most exciting or important thing happening in your space?

I was going to say in the Java world that lambda expressions are the most important things, but they’re not. There's a broader trend at work here: that programming languages are becoming inherently multi-paradigm. It’s not just Java that has accepted that functional and object-oriented code can live together in harmony. Newer programming languages all utilize some functional and some object-oriented concepts, and this increasing cross-pollination is likely to continue for the next decade or more.

Lesser spotted eagle (Aquila pomarina)

The animal on the cover of Java 8 Lambdas is a lesser spotted eagle (Aquila pomarina). This large bird of prey can be found in Eastern Europe and belongs to the family Accipitridae, like all typical eagles. The lesser spotted eagle is medium-sized with a head and bill that are small for eagles; these eagles typically measure up to 60 cm in length with a 150 cm wingspan.

Book Description

Functional Programming for the Masses