A New Challenger Approaches
In this chapter, you'll gain an understanding of what Kotlin is, how it came about, and why it's quickly gaining popularity. You'll find a high-level overview of key language features, as well as the design principles behind the language itself. Finally, this chapter will lay the foundations for the following chapters' focus on features, patterns, platforms, and best practices for improving your understanding of the Kotlin programming language.
This chapter covers the following topics:
- Creating a modern language for the Java Virtual Machine (JVM)
- Moving beyond the JVM
- Designing Kotlin with best practices in mind
- Checking in on the current state of Kotlin
Technical requirements
In order to download, compile, and execute the samples found in this chapter, you must have the following:
- IntelliJ IDEA 2018.3 Community or Ultimate editions, or newer
- An internet connection
- Git and GitHub (optional)
To download all of the code in this chapter, including the examples and code snippets, please refer to the following GitHub link: https://github.com/PacktPublishing/Mastering-Kotlin/tree/master/Chapter01.
Creating a modern language for the JVM
Kotlin was born out of a desire for a modern programming language that could be run on the JVM while still being fully compatible with Java and existing Java tooling. With these goals in mind, Kotlin has evolved into one of the fastest growing programming languages in the world and continues to carve out space for itself across multiple domains.
In this section, we're going to dive into what Kotlin is, how it came to be, and why it's great for developers.
What is Kotlin?
So, what exactly is...
Moving beyond the JVM
Kotlin may owe its origin to JVM interoperability, but it has quickly moved beyond pure JVM applications. One of the early wins for Kotlin was acceptance in the Android development community where most developers were required to use Java 6 or Java 7. Kotlin enabled Android developers to use language features, such as lambdas, which were not available on older versions of Java.
Outside of Android, Kotlin can now be transpiled to JavaScript, used in multiplatform mobile applications, or compiled to run natively on macOS, Windows, and Linux.
Kotlin for Android
To date, Kotlin has received the most popularity in the Android development community. Kotlin starting gaining traction for Android development in...
Designing Kotlin with best practices in mind
Kotlin has been designed based on decades of experience from working with Java and other programming languages. By building on this experience, JetBrains has worked to improve the developer experience with Kotlin by focusing on things such as first-class tooling support from day one, fast build times, and bringing modern features and best practices to the language design.
Learning from Java
Kotlin is 100% compatible with Java through the bytecode that allows both to target the JVM. Kotlin's origin stems from wanting modern language features and compile speeds that other JVM languages couldn't provide. Because of these, Kotlin is heavily influenced by Java, but can improve...
Checking in on the current state of Kotlin
Today, Kotlin is one of the fastest growing languages in the world. It has already proven itself for Android development and is now starting to find a home in other domains as well.
Developing Kotlin in the open
Since its public announcement, JetBrains has been very open with the development of Kotlin. This includes a public issue tracker, regular blog posts, conference talks, a yearly Kotlin census, and they even have their own conference now, KotlinConf.
Kotlin has seen four major stable releases to date, which are as follows:
- v1.0:...
Summary
Kotlin is a modern programming language that can be used to build applications across mobile, the web, and native platforms. Since its inception, JetBrains has developed Kotlin to provide an excellent developer and integration experience so Kotlin can be learned gradually and slowly integrated into existing projects. The design and development of the language has been done very much in the open, and you can view the Kotlin issue tracker and submit your own ideas, issues, and feedback to help contribute to the language. Kotlin's popularity continues to increase rapidly, and its ability to target a variety of platforms makes it likely that the popularity trend will continue.
In this book, you'll learn firsthand why Kotlin is growing so rapidly. We'll start by exploring different application architectures, and how to model data and manage state using Kotlin...
Questions
- Which company started the development of the Kotlin programming language?
- When was Kotlin announced to the world?
- Who is the lead designer of Kotlin?
- What platforms did Kotlin initially target?
- Which platforms are currently supported by Kotlin?
- For which platform has Kotlin gained the most popularity?
- List two factors that have contributed to the rapid growth of Kotlin.
Further reading
- Kotlin Quick Start Guide, published by Packt (https://www.packtpub.com/application-development/kotlin-quick-start-guide)
- Kotlin Programming By Example, published by Packt (https://www.packtpub.com/application-development/kotlin-programming-example)
- Learning Kotlin by Building Android Applications, published by Packt (https://www.packtpub.com/application-development/learning-kotlin-building-android-applications)
- Kotlin Programming By Example, published by Packt (https://www.packtpub.com/application-development/kotlin-programming-example)