RizTech Academy logo
RizTech Academy
Getting StartedLesson 1 of 410 min

Why Kotlin, and where it runs

Before you write a line of Kotlin, it is worth knowing exactly what it is for — and what it is not. Choosing a language because it is fashionable is how people end up fighting their tools. Kotlin is a genuinely good choice for a specific set of jobs, and an unremarkable one for others.

What Kotlin is

Kotlin is a modern, statically-typed language from JetBrains — the company behind IntelliJ IDEA — first released in 2011 and now maintained openly. It runs primarily on the Java Virtual Machine (JVM), which means it compiles to the same bytecode Java does and can use every Java library ever written. That single fact explains most of Kotlin's design: it was built to fix Java's day-to-day frustrations while keeping Java's enormous ecosystem.

The headline reasons people reach for it:

  • Null safety built into the type system. The single most valuable feature, and the reason a whole module of this course is devoted to it. Kotlin makes the difference between "a value" and "a value that might be missing" part of the type, so the compiler catches the mistake that causes more crashes than any other.
  • Far less ceremony than Java. A data class that would be fifty lines of Java is one line of Kotlin. Less code to write, and less code to read.
  • Modern features as standard — lambdas, extension functions, coroutines for asynchronous work, and expressions that return values where other languages force statements.
  • It interoperates with Java both ways. You can call Java from Kotlin and Kotlin from Java in the same project, which is why teams can adopt it gradually rather than rewriting everything.

Where Kotlin runs, and what it is really for

Android is the reason most people learn Kotlin. In 2019 Google made Kotlin its preferred language for Android development, and today the overwhelming majority of new Android code is Kotlin. If your goal is to build Android apps — and for a great many developers in India that is the goal, because Android is what most people carry — then Kotlin is not one option among many. It is the option, and learning it well is the prerequisite to everything else.

That is the honest framing of this whole course: learn Kotlin properly first, on its own, so that when you start Android the framework is the only new thing you are learning. People who try to learn Kotlin and Android at the same time end up unable to tell which confusion belongs to which, and they cargo-cult code they do not understand. This course deliberately keeps Android out of the way until the language is solid.

Kotlin also runs in other places, worth knowing but not our focus:

  • Server-side / backend — with frameworks like Ktor and Spring Boot, Kotlin is a strong choice for web services, competing directly with Java.
  • Kotlin Multiplatform (KMP) — share business logic across Android, iOS, web and desktop from one codebase. This is an advanced topic and its own course; it builds directly on the foundation you are laying here.
  • Kotlin/Native and Kotlin/JS — compile to native binaries or to JavaScript, for cases where the JVM is not available.

What Kotlin is not for

Being fair about the limits saves you from picking the wrong tool later:

  • It is not the language for iOS-only apps. If you are building solely for iPhone, Swift is the native choice — this course's sibling covers it. (Kotlin Multiplatform can share logic with iOS, but the iOS UI is still Swift.)
  • It is not a scripting language for quick data tasks. For a throwaway script to clean a CSV or scrape a page, Python is faster to reach for — the JVM startup and the compile step are overhead you do not want for a ten-line job.
  • It is not for systems programming where you need to control memory directly — that is Rust, C or C++.
  • It is not a way to avoid learning programming fundamentals. Kotlin makes good habits easier, but a poorly-designed program is poorly-designed in any language.

Kotlin versus Java, briefly

You will hear "Kotlin is just nicer Java", which is roughly true and slightly misleading. Kotlin runs on the JVM and uses Java's libraries, so in that sense they are cousins. But Kotlin made different default choices, and the defaults are the point:

  • Java values are nullable unless you are careful; Kotlin values are non-null unless you say otherwise.
  • Java variables are mutable unless you write final; Kotlin encourages val (immutable) as the default.
  • Java is verbose by design; Kotlin removes the ceremony.

You do not need to know Java to learn Kotlin — this course assumes none. But if you already know Java, the mental shift is mostly "the safe choice is now the default", which is a pleasant direction to move in.

What you will be able to do after this course

By the end you will be able to read and write idiomatic Kotlin confidently: model a domain with classes and null safety, transform data with collections, write asynchronous code with coroutines, test it, and structure a real project — to the standard a team would expect on day one. That is the foundation the Android course assumes, and it is worth getting solid before you build on it.

Check your work

What Kotlin is. A modern, statically-typed JVM language from JetBrains that fixes Java's frustrations while keeping its ecosystem.

Kotlin's single most valuable feature. Null safety built into the type system.

Why Kotlin runs on the JVM matters. It can use every Java library, and interoperate with Java both ways, so teams adopt it gradually.

The main reason to learn Kotlin. Android — Google's preferred language for it since 2019.

This course's approach, and why. Learn Kotlin on its own first, so Android is later the only new thing; learning both at once makes it impossible to tell which confusion is which.

Three things Kotlin is not for. iOS-only apps (Swift), quick throwaway scripts (Python), and systems programming with manual memory control (Rust/C/C++).

The core mental shift from Java. The safe choice — non-null, immutable — is now the default.

Practice

  1. In one sentence, write down why you are learning Kotlin. If the answer is Android, note that the language comes first.
  2. List three apps on your phone. For each, guess whether it is likely written in Kotlin (Android), Swift (iOS), or both.
  3. Find one Java library online (for example, a PDF or JSON library) and note that Kotlin could use it unchanged. This is the interoperability point.
  4. Write down one task you would not use Kotlin for, and which language you would use instead.
  5. Explain to someone, in two sentences, the difference between "Kotlin the language" and "Android the framework". This distinction will save you weeks later.

Official documentation

Next: installing the tools and getting Kotlin running on your machine.

Stuck on this lesson?

Being stuck is part of it — but being stuck alone for three days is not. Our internship programme pairs this curriculum with code review and one-to-one help from working developers, and it is free.

About the internship