One of the core tenets of functional programming is the transformation of data through the application of pure functions. According to the strictest definitions of functional programming, these pure functions are expressed as mathematical operations. This pure, mathematical nature of functional programming gives rise to two interesting properties:
- The immutability of variables
- The lack of side effects
These properties of functional code can be of great benefit when writing code in Kotlin, or any other language, and we will explore them both in the sections that follow.