Front matter

 

preface

Although Kotlin appeared in 2011, it’s one of the newest languages in the Java ecosystem. Since then, a version of Kotlin running on the JavaScript virtual machine as been released, as well as a version compiling to native code. This makes Kotlin a much more universal language than Java, although there are great differences between these versions because the Java version relies upon the Java standard library, which isn’t available in the two others. JetBrains, the creator or Kotlin, is working hard to bring each version to an equivalent level, but this will take some time.

The JVM (Java Virtual Machine) version is by far the most used version, and this has seen a great boost when Google decided to adopt Kotlin as an official language for developing Android applications. One of the primary reasons for Google’s adoption was that the version of Java available under Android is Java 6, whereas Kotlin offers most of the features of Java 11 and much more. Kotlin was also adopted by Gradle as the official language for writing build scripts to replace Groovy, which allows using the same language for the build and for what is built.

Kotlin is primarily targeted at Java programmers. There might come a time when programmers will learn Kotlin as their primary language. But for now, most programmers will only be transitioning from Java to Kotlin.

acknowledgments

about this book

Who should read this book

What you’ll learn

Pushing abstraction further

Immutability

Referential transparency

Encapsulated state mutation sharing

Abstracting control flow and control structures

Using the right types

Laziness

Audience

How this book is organized: A roadmap

Completing the exercises

Learning the techniques in this book

About the code

liveBook discussion

about the author

about the cover illustration