The Java Virtual Machine (JVM) has been around for over 20 years now with Java as the king. Learn about why the world needs a new JVM language and why that language is Kotlin.
- [Instructor] Java is over 20 years old. As languages age, they tend to pick up a lot of cruft. Java is no exception. Perhaps the most irritating bit of boilerplate are getters and setters. Yes, many IDEs will autogenerate them but they are still there. The null pointer exception is one of the most dreaded things Java developers face. Null data creeps into programs from many sources and weeding it out is tedious. Over the last 20 years there have been many new languages with great features.
While Java has introduced new versions it still lacks a lot of the best new features. Java is one of the most popular languages in the world. Any language hoping to replace it must be compatible with it. Kotlin is 100% compatible with Java. Kotlin's type system eliminates most null winner exceptions. In fact, if you write pure Kotlin code you can completely avoid them. Kotlin is more streamlined than Java without being terse. It doesn't require boilerplate code.
Kotlin has a lot of modern language features like type inference, properties, and smart testing. Here is a simple Hello World program. Java, being class-based, requires the creation of a class even to do something as simple as writing line of text to the screen. The Kotlin version doesn't need a class. And it autoimports many popular packages like print line. (mumbling) estimates that code doing identical functions is 40% smaller in Kotlin than in Java.
- Kotlin as a better Java
- Setting up a Kotlin programming environment
- Val vs. var
- Understanding basic Kotlin programming concepts
- Object-oriented programming
- Using Java from Kotlin
- Using Kotlin from Java
- Annotations, reflection, and DSL construction
- Functional programming in Kotlin