© Peter Späth 2019
Peter SpäthLearn Kotlin for Android Developmenthttps://doi.org/10.1007/978-1-4842-4467-8_12

12. Back to Math: Functional Programming

Peter Späth1 
(1)
Leipzig, Germany
 
If you look at the examples and exercises presented so far in this book you can see that we fluctuate between two styles of programming:
[statement1] // do something
[statement2] // do something
[statement3] // do something
...
and
object.
    doSomething1().
    doSomething2().
    doSomething3().
    ...

The first style is about a sequence of imperatively telling what a program has to do, whereas the second is about sequentially applying functions on objects in a function invocation chain. Because of this, the first style also gets called imperative programming , and the ...

Get Learn Kotlin for Android Development: The Next Generation Language for Modern Android Apps Programming 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.