Mastering Kotlin style and best practices
As we learned in Chapter 1, Kotlin is a very concise and static language. As such, it is easier for us as developers to not follow some of the recommended practices. This leads to a lot of code smells and technical debt. A code smell is a pattern or practice that might indicate a deeper problem within the code. It indicates that the code might lead to potential problems or hinder maintainability. On the other hand, technical debt refers to the cost or consequences of choosing quick and suboptimal solutions in development to meet immediate needs rather than developing robust and maintainable solutions. We always have to come back later to such solutions to refactor them to be more scalable and maintainable. Let us start by learning about some of the best practices and how to avoid them.
Coding conventions
Kotlin has a wide variety of coding conventions that cover everything from naming conventions to formatting. Following these conventions...