Pebellslearn by building
0%
RoadmapsMatrixCoursesSandboxSign in
Introduction to Kotlin  ›  Lesson

Where Kotlin Came From and Why Use It

History of Kotlin 12 minKotlin is a JetBrains language, stable since 2016 and preferred for Android since 2019, chosen for concise code, built-in null safety and full use of existing Java libraries.

Where Kotlin Came From and Why Use It

Imagine the Pebble Café order app crashes every Friday because some customer's name turned out to be missing. The code was written in Java, and nothing warned anyone that the name could be empty. Kotlin was created by people who were tired of exactly this kind of bug.

The rule

Kotlin: Java's world, less typing, nulls caught before running.

Where it came from. Kotlin was built by JetBrains, the company behind the IntelliJ IDEA editor. They announced it in 2011 and named it after Kotlin Island, near St Petersburg, where much of the team worked. Version 1.0, the first release promised to stay stable, arrived in February 2016. In 2017 Google announced official Android support, and in 2019 it declared Android development "Kotlin-first". Kotlin 2.0, released in 2024, brought a rewritten, faster compiler called K2.

Why teams use it. Three reasons come up again and again:

  • Less ceremony. A class that holds a few values can be one line instead of a page of getters and setters.
  • Null safety. The type String can never hold null; the type String? can. The compiler makes you handle the second case.
  • It runs where Java runs. Kotlin compiles to the same bytecode as Java, so it can use every Java library and run on any Java virtual machine (JVM).
val cafe: String = "Pebble Café"   // can never be null
val nickname: String? = null       // allowed: the ? says "maybe missing"

Kotlin also compiles to JavaScript, to WebAssembly and to native machine code, which lets one codebase share logic between Android, iOS, web and server. That is a later topic; for this course we stay on the JVM.

The shortcut

When you hear about any Kotlin feature, file it under one of three labels: shorter, safer, or compatible. Almost every design choice in the language serves one of them.

Sorting three claims about KotlinStep 1 of 4
  1. "A data class writes equals and toString for you"

    That removes boilerplate you would type by hand in Java: shorter.

A common misreading is that Kotlin is "only for Android". Android made it famous, but it is equally at home in server applications, command-line tools and shared multiplatform code.

Drills

Answer fast — trust the rule.

quick drill

Which company created Kotlin?

quick drill

In what year did Kotlin reach its first stable 1.0 release?

quick drill

Which label best fits "Kotlin code can use any existing Java library"?

quick drill

What does the ? in val nickname: String? = null tell the compiler?

Remember

  • Kotlin comes from JetBrains: 1.0 in 2016, Android-preferred since 2019, K2 compiler in 2.0.
  • Every feature is roughly one of: shorter, safer, compatible.
  • Kotlin runs wherever Java runs, and far beyond Android.

Practice — level up

0/1 solved

Write your answer, then compare it with a rubric and a model answer.

ExplainPitch Kotlin to a Java team

The Pebble Café app is written in Java and crashes now and then with a NullPointerException. Explain to the team, in a short paragraph, why moving to Kotlin could help and why they would not have to throw away their existing Java code.