Goodbye helpers – embracing top-level and extension functions and properties

A common pattern in Java is to have the helper and util classes that exist solely for the purpose of storing static methods and data that needs to be accessible to the code base. These are classes such as StringUtils, DateUtils, and ViewHelpers. In Kotlin, we have another option.

Top-level functions and properties allow us to replace these types of helper and util classes with globally available functions and/or extension functions. This can not only remove the classes, but make our APIs cleaner by making these types of helper functions feel like first-class parts of the language.