Kotlin's popularity has skyrocketed in recent months due to the fact that it is a simple and concise language that is easy to learn and supports object-oriented and functional programming. Kotlin is a superset of Java that avoids all unwanted Java features, such as verbose, unsafe, and outdated syntax, and includes powerful features from different languages. These features include security, simplicity, and interoperability.
This chapter enables us to acquire knowledge about Kotlin and introduces its basic features and functionality, aiming to get us started as quickly as possible. Before reaching the end of this chapter, we will be familiar with Kotlin's syntax, simplicity, and security features, as well as Kotlin's underlying approach towards object-oriented programming.
The following topics will be covered in this chapter:
- Kotlin's history
- Data types and ease of declaration
- Kotlin's null safety and type casting
- Flow control and if statements as an expression
- Loops and labeled loops
- Functions, functions as an expression, and named parameters