Loops are a basic paradigm in imperative programming languages. In functional languages you also need to loop, but you do it differently. Here, I present how I prefer to implement loops in a functional style using Kotlin. To check, if this is a good idea at all, I do some benchmarks against imperative variants and good old Haskell.Continue reading
Java 8 introduced with
Optional a functional datatype that enables the developer to work with optional values without nested if-statements. This can simplify your code a lot.