What Kotlin Is and Why It Took Over Android
A modern language on the JVM
Kotlin is a statically-typed language created by JetBrains that runs on the Java Virtual Machine. Its design goals are pragmatic: be more concise and safer than Java while remaining completely interoperable with it. Kotlin compiles to the same bytecode Java does, so a Kotlin class and a Java class can call each other freely in the same project.
Less ceremony than Java
The same idea is shorter and clearer in Kotlin. Type inference, no semicolons, and no boilerplate getters/setters remove a lot of noise:
// Java
String name = "Ada";
System.out.println(name);
// Kotlin
val name = "Ada"
println(name)
val declares a read-only value; var declares a mutable one. The type String is inferred, so you rarely write it.
Safer by design
Kotlin bakes null-safety into the type system, so the dreaded NullPointerException is largely eliminated at compile time (covered in a later lesson). It also favours immutability and expressions over statements, which leads to fewer bugs.
Why Android chose it
In 2019 Google made Kotlin its preferred language for Android. The reasons are the same ones that make it pleasant on the server: less boilerplate, null-safety, and seamless use of the enormous existing Java ecosystem. Today Kotlin is used well beyond Android — for backend services (Spring supports it first-class), tooling and multiplatform code.
Key points
- Kotlin is a statically-typed JVM language, fully interoperable with Java.
valis read-only,varis mutable; types are usually inferred.- Null-safety and concise syntax make it safer and shorter than Java.
- It is Google's preferred Android language and popular for backend work too.