Kotlin includes first-class support for functions, which means that functions can be invoked, and entire applications written, without having to rely on classes and methods as in Java. This represents a significant shift in how code is written using Kotlin.
This support for functions enables a variety of useful features in the language:
- Functional programming can be achieved because of Kotlin's functions.
- Extension functions give the ability to modify and adapt APIs to fit our needs.
- Higher-order functions are the backbone of the Standard library.
- First-class functions allow developers to remove entire categories of "helper" and "utility" classes that existed for the sole purpose of containing static methods.