# Kotlin

> A modern, more concise language that runs where Java runs, and the main one for Android.

- Level: Intermediate
- Topics: Software
- URL: https://tidbit.legios.com.ar/kotlin/
- In Spanish: [Kotlin](https://tidbit.legios.com.ar/es/kotlin/)

**Kotlin** is a programming language created by JetBrains, the company behind the IntelliJ IDEA editor. It was announced in 2011 and reached version 1.0 in 2016. Like Java, it compiles to bytecode that runs on the JVM, so a Kotlin program can call Java libraries directly, and a team can add Kotlin files to an existing Java project one at a time.

The point was to keep everything good about the Java world while removing the boilerplate. The same class that takes thirty lines in classic Java can take three in Kotlin. It also attacks one of Java's most common crashes: by default a variable cannot hold `null` ("nothing"), and if you want it to, you have to say so with a `?`, so the compiler forces you to handle the empty case before the program ever runs.

Its big moment came in 2017, when Google announced official Kotlin support for Android; two years later it declared Android development "Kotlin-first". Today most new Android apps and Google's own Android samples are written in Kotlin. It is also used for backend servers, and it can compile to JavaScript and to native code for sharing logic between Android and iOS.

## An analogy

A renovated house on the same foundations. The plumbing and wiring (the JVM and Java libraries) are the same, but the rooms are redesigned so you walk less and trip less.

## Keep in mind

- Made by JetBrains; version 1.0 came out in 2016.
- Runs on the JVM and mixes freely with Java code in the same project.
- Google's preferred language for Android since 2019.
- Built-in null safety catches a whole family of crashes at compile time.

## Go deeper

- [Get started with Kotlin (official docs)](https://kotlinlang.org/docs/getting-started.html)
- [Kotlin and Android (Android Developers)](https://developer.android.com/kotlin)
- [Kotlin on Wikipedia](https://en.wikipedia.org/wiki/Kotlin_(programming_language))

## Related terms

- [Programming language](https://tidbit.legios.com.ar/programming-language/): A precise, written language people use to give instructions to a computer.
- [Java](https://tidbit.legios.com.ar/java/): A long-lived programming language behind many bank systems, big business apps and Android.
- [Compiler](https://tidbit.legios.com.ar/compiler/): A program that translates source code into instructions a computer can run directly.
- [Google](https://tidbit.legios.com.ar/google/): The search company that gives most products away and makes its money on ads.
- [Frontend and backend](https://tidbit.legios.com.ar/frontend-and-backend/): The part of an app you see and touch, and the part that works behind it.
- [Server](https://tidbit.legios.com.ar/server/): A computer whose job is to answer requests from other computers, all day, every day.
- [JavaScript](https://tidbit.legios.com.ar/javascript/): The programming language that runs inside web pages and makes them interactive.
