The Kotlin Programming LanguagePublished on 21 April 2019 (Updated: 21 April 2019)
Since Kotlin is a bit more popular than most of the newer languages, it actually has a Wikipedia page. So, we’ll use that to learn more.
In terms of features, Kotlin offers an aggressive form of type inference. In other words, the language supports static type checking on implicit types. Of course, the benefit is a far less verbose syntax than Java.
Of course, I think my favorite feature is extension methods. In Kotlin, we can take a class that already exists and tack on our own methods without creating an extension class. For instance, Wikipedia shares the following snippet:
fun String.lastChar(): Char = this.get(this.length - 1)
In this example, the lastChar method is added to the String class. How cool is that?1
- Hello World in Kotlin on 03 April 2019 by Jeremy Grifski
J. Grifski, “Hello World in Kotlin,” The Renegade Coder, 29-Apr-2018. [Online]. Available: https://therenegadecoder.com/code/hello-world-in-kotlin/. [Accessed: 21-Apr-2019]. ↩