Next lesson playing in 5 seconds

Cancel
  • Overview
  • Transcript

1.2 Kotlin Overview

Hello, in this lesson, we will learn what is Kotlin. Is it better than Java? Is it meant to replace Java? And what are the benefits, and how Kotlin is better than Java. So, lets get started without wasting further time. Kotlin was announced as an official language for Android at Google I/O 2017. Before this, we just had Java as the official language for Android. But with this announcement, we got Kotlin, too. Kotlin is developed by Jetbrains. Jetbrains has built Intellij IDEA. And if you are an Android developer, I'm sure you're aware of the fact that Android Studio is built on top of Intellij IDEA. So now we know how important and how big Jetbrains is. And thus, we can completely trust it for Kotlin. Kotlin is an Open Source project primarily for Apache. And since it is open source, it promotes the developer's ecosystem to be united and the developers can thus contribute better. Since we have known a little bit about Kotlin, let's discuss if it will replace Java? Will Kotlin Replace Java? No, it won't replace Java, because there are Numerous projects out there in the market that are based on Java. And it is not very easy to replace those Java based projects by Kotlin. So we can say that Java and Kotlin will stay side by side in the market. Kotlin can be used with Java for newer applications. As I already said, we can use Kotlin as well as Java in the same project. Yes you saw it right. Kotlin is flexible and it is an enhancement to Java. Rather than being a complete rewrite, we will have Kotlin to enhanced Java. But how, how is it flexible and is it an enhancement to Java. Let's see how it is. Why should we adopt Kotlin. It is an enhancement to Java as I have already said. It is Concise, we need to write very few lines of code unlike Java, so it drastically reduces the boilerplate codes. Kotlin is Safe, how is it safe? It eliminates the null references by making all types non-nullable by default. So we are not going to have anymore null pointer exceptions like we used to have this in Java. If you want to define a null variable in Kotlin, we have to specify it. And thus, making the null pointer exceptions zero. Kotlin is Interoperable. Kotlin can be used with Java in the same project. It leverage the existing libraries for the JVN, Android and the browser. Kotlin is tool-friendly. They can choose any java IDE for writing codes in Kotlin. We can also build our applications using Kotlin, from the command line, hence, Kotlin is tool-friendly. We have some more features of Kotlin that makes it attractive. One of the Kotlin's main feature is that it supports Higher Order Functions, Lambdas, and String Templates. What are Higher Order Functions? I'll tell you about it in the upcoming lessons. But as an introduction, I can say that Higher Order Functions are the functions which accepts other functions as its parameter or it can also return functions as the written value. In the next lesson we will be installing the Intellij IDE and begin encoding in Kotlin. See you in the next less, thank you and have a great day.

Back to the top