Functional programming

Functional programming languages rely on pure transformations of data to perform work. This approach differs from Object-Oriented Programming rather significantly because functional programming avoids mutable data and a global state. 

With Kotlin's support for first-class functions and its large Standard library, it's possible to use it to write highly functional programs as well. The following snippet is a small example of how functional code can be written in Kotlin by chaining multiple function calls together and processing data without side-effects:

// Performing multiple filter operations on an input list
studentList
.filter { student -> student.grade == 11 }
.filter { student -> student.gpa > 3.5 }

In Chapter 12, Fully Functional – Embracing Functional Programming, you'll learn more about how to write functional programs in Kotlin as well as some tools that make this easier to accomplish.