Less Typing

You’ll do less typing—that act of hammering keys on the keyboard—to create applications with Kotlin. That’s because a lot of things we’ve come to take for granted as required are optional in Kotlin.

Semicolon Is Optional

When you start programming in Kotlin, your right pinky immediately gets relief from repetitive stress injury that it may have endured for most of your programming career. Though you could, you don’t have to end every single statement or expression with a semicolon. Use the semicolon sparingly—only on occasions when you want to place two or more expressions or statements on a single line.

The following example, is valid syntax in Kotlin, and can be written standalone:

 6 * 2

At first thought it may not appear to be ...

Get Programming Kotlin now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.