Wrapping Up

Kotlin removes a lot of ceremony from the most fundamental programming tasks. For the same task, you’ll often find that you type a lot less in Kotlin than you would in a number of mainstream languages. The semicolon is optional, variable declarations enjoy type inference, you’re not forced to place everything into a class or even a function, exception handling is not forced on you—these things ease the burden on programming. At the same time, Kotlin has sensible warnings to save you from common errors. It also improves safety by asking you to choose between immutability and mutability early on. Additionally, equality check is null safe. String templates and multiline strings reduce the effort to create strings with expressions. And, Kotlin provides more expressions than statements when compared to languages like Java, C#, and JavaScript.

We’ve focused on expressions and statements in this chapter. Next, we’ll step up to working with functions.

Get hands-on with 1200+ tech skills courses.