Chapter 2. Using the Functional Constructions of Java 8

Functional programming is not a new idea; actually, it's pretty old. For example, Lisp, which is a functional language, is the second oldest of today's commonly-used programming languages.

Functional programs are built using small pieces of reusable pure functions (lambdas). The program logic is composed of small declarative steps and not complex algorithms. That's because functional programs minimize the use of state, which makes imperative programs complex and hard to refactor/support.

With Java 8, the Java world got the lambda expressions and the ability to pass functions to functions. With them, we can code in a more functional style and get rid of a lot of the boilerplate code. The other ...

Get Learning Reactive Programming with Java 8 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.