1 What is functional programming?
This chapter covers
- Understanding side effects and the problems they pose
- Achieving a functional solution by removing side effects
- Defining what a pure function is
- Proving referential transparency and purity using the substitution model
Most of us started programming using an imperative style of coding. What do we mean by this? It means we give the computer a set of instructions or commands, one after the other. As we do so, we are changing the system’s state with each step we take. We are naturally drawn to this approach because of its initial simplicity. On the other hand, as programs grow in size and become more complicated, this seeming simplicity will lead to the very opposite; complexity arises and ...
Get Functional Programming in Kotlin 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.