Hello Kotlin
Tags: learnkotlinfromgde, android, gde, learnkotlin
Published: 2019-11-10 10:35:58

---
title: Hello Kotlin
published: true
date: 2019-11-10 10:35:58 UTC
tags: learnkotlinfromgde,android,gde,learnkotlin
canonical_url: https://medium.com/@magdamiu/hello-kotlin-774b44cd9df0
---

![](https://cdn-images-1.medium.com/max/960/1*QYcjJgoaFzLg1QjMQtQgAA.png)

At this moment, in the world, there are more than 5000 programming languages available. Now, the first question asked by us, the developers, is why do we need another programming language like Kotlin?

**Kotlin** is a general-purpose language that supports both functional programming and object-oriented programming paradigms. It’s an open-source project developed mainly by _JetBrains_ with the help of the community. Like Java, Kotlin is a statically typed language, however, in Kotlin we can skip the types.It’s an open-source (_Apache 2.0_) project developed mainly by JetBrains with the help of the community.

The Kotlin philosophy is to create a **modern** and **pragmatic** language for the industry, not an academic one. Pragmatic means getting things done, and in terms of programming represents the capability to easily transform an idea into software.

Kotlin is based on many programming languages like Java, Scala, C#, Groovy, Python and it tries to reuse what works better in those languages.

The name of the language represents the name of an island according to [Wikipedia](https://en.wikipedia.org/wiki/Kotlin_Island): “ **Kotlin** is a Russian island, located near the head of the Gulf of Finland, 32 kilometres (20 mi) west of Saint Petersburg in the Baltic Sea.”

![](https://cdn-images-1.medium.com/max/640/0*L_NuqKr2sKM1o8w7)

Kotlin is a popular language: in the latest Stack Overflow developer [survey](https://insights.stackoverflow.com/survey/2019#most-loved-dreaded-and-wanted), it ranks as the **4th most loved programming language** and it is used to developer apps like Pinterest, Uber, Slack, Trello, etc

The Kotlin project was started in **2010** and it took 6 years in order to validate all the design choices made. The community was involved in this project, because community it is not only about validation but also about inspiration.

In **2017** Google officially announced at Google I/O that Kotlin is a first-class citizen in the Android world.

In **2018** JetBrains launched the 1.3 version and this year they launched **1.3.50 version**.

![](https://cdn-images-1.medium.com/max/640/0*O7cnsOqEiLEfBXA2)

![](https://cdn-images-1.medium.com/max/640/0*x0xwDrpa0D6P1GAC)

![](https://cdn-images-1.medium.com/max/640/0*d8mC6NFv2hUy1NCc)

#### **✅ Conventions**

- The same conventions like on Java
- Uppercase for types
- Lower camelCase for methods and properties
- Semicolons are optional
- Reverse notation for packages
- A file could contain multiple classes
- The folder names not have to match the package name

#### 🛠️ **Development & Build tools**

- Kotlin/JVM : JVM 1.6+
- Kotlin/JavaScript: transpile to JavaScript and it offers readable generated JS code
- Kotlin/Native (C, Swift, Objective-C): compiles to native binaries using LLVM and it does not suppose to have a Virtual Machine
- Editor or IDE: IntelliJ IDEA, Android Studio, NetBeans, Eclipse
- Build tools: On the JVM side, the main build tools include [Gradle](https://kotlinlang.org/docs/reference/using-gradle.html), [Maven](https://kotlinlang.org/docs/reference/using-maven.html), [Ant](https://kotlinlang.org/docs/reference/using-ant.html), and [Kobalt](http://beust.com/kobalt/home/index.html). There are also some build tools available that target client-side JavaScript.

![](https://cdn-images-1.medium.com/max/960/1*zxCwZLVGt5IgpZXDfTGHpw.png)

![](https://cdn-images-1.medium.com/max/960/1*L6IgeMeFpvQZ6-1_BTV0Qw.png)

#### 📌Main advantages of Kotlin

**Readability:**

It’s already known that developers spend more time reading existing code than writing new code. And we also know that a code is clean if it is easy to understand.

Imagine you’re a part of a team developing a big project, and you need to add a new feature or fix a bug. What are your first steps? You read a lot of code to find out what you have to do. This code might have been written recently by your colleagues, or by someone who no longer works on the project, or by you, but long ago. Only after understanding the surrounding code you can make the necessary modifications.

**Interoperability**

Regarding interoperability, our first concern probably is, “Can I use my existing libraries?” With Kotlin, the answer is, “Yes, absolutely!”

**Safety**

In general, when we speak about a programming language as being safe, we mean its design prevents some specific type of errors in a program. For example, in Kotlin, the designers of the language worked to eliminate the NPE.

**Tooling**

Kotlin is a compiled language. This means before we can run Kotlin code, we need to compile it. And in terms of tools, we have a lot of possibilities here.

#### 🔖 Best practices

1. Agree on a set of **conventions** before you start to write code in Kotlin
2. **Don’t treat it as Java** with a different syntax
3. Use a linter (like  **ktlint** )
4. **Don’t hide** too much info
5. Choose **readable** over short expressions

#### **📚 Resources to learn Kotlin**

- [Kotlinlang.org](https://kotlinlang.org/): The official Kotlin website. Includes everything from a guide to [basic syntax](https://kotlinlang.org/docs/reference/basic-syntax.html) to the [Kotlin standard library reference](https://kotlinlang.org/api/latest/jvm/stdlib/index.html).
- [Kotlin Koans Online](http://try.kotlinlang.org/): A collection of exercises in an online IDE to help you learn the Kotlin syntax.
- [Udacity course](https://www.udacity.com/course/kotlin-bootcamp-for-programmers--ud9011): “Kotlin Bootcamp for Programmers”. Essentials of the Kotlin programming language from Kotlin experts at Google. For programmers coming from Java or other object- oriented languages.
- [O’Reilly course](http://shop.oreilly.com/product/0636920052982.do): An 8-hour Kotlin course, “Introduction to Kotlin Programming,” by Hadi Hariri, a developer at JetBrains. Requires subscription; 10-day free trial available.
- [Treehouse course](https://teamtreehouse.com/library/kotlin-for-java-developers): “Kotlin for Java Developers” teaches Kotlin with an emphasis on Android. Requires subscription; 7-day free trial available.
- [@kotlin](https://twitter.com/kotlin): The official Kotlin Twitter account.
- [Kotlin Community](https://kotlinlang.org/community/): A list of offline events and groups from kotlinlang.org.
- [Kotlin Slack](http://slack.kotlinlang.org/): A Slack chat community for Kotlin users.
- [Talking Kotlin](http://talkingkotlin.com/): A bi-monthly podcast on Kotlin and more.

![](https://cdn-images-1.medium.com/max/1024/1*jP-6BxHaaQ0D7bn5k-NRlQ.png)


Enjoy and feel free to leave a comment if something is not clear or if you have questions. And if you like it please 👏 and share !

Thank you for reading! 🙌🙏😍✌

Follow me on Twitter: [Magda Miu](https://twitter.com/MagdaMiu)