In this chapter, we explored different programming paradigms that are supported by Kotlin. We compared imperative programming and declarative programming and examined both the object-oriented and functional programming paradigms. Kotlin supports, but does not enforce, all of these programming paradigms along with other models of programming, such as generic and reactive programming. Kotlin aims to provide support and make it convenient to write code in whichever way works best for you.
Kotlin has support for classes, interfaces, and other common OOP language features; in addition to strongly enforcing OOP principles such as encapsulation. Kotlin supports first-class functions and higher-order functions, and provides a rich Standard Library that can be used to write pure functional code. Support for Coroutines, Channels, and RxJava provides multiple options for maintaining...