Kotlin is a fairly new programming language from JetBrains, the people behind InteliJ. It's draws on the best bits of languages like Java, C#, Groovy, to provide us with an easy-to-learn powerful tool for writing great software
2. Котлин (https://kotlinlang.org/)
• Released in 2011 – v1.0 in 2016
• Under Apache 2.0 Licence
• By JetBrains, based in St Petersburg (Санкт-Петербург)
• Who make IntelliJ, WebStorm, PyCharm, RubyMine, etc.
• Named after an Island off the coast from St Petersburg
• Runs on the JVM (hence will work in Amazon Lambda)
• Supports both static typing and using type inference
• Now on version 1.3
• Personally I think it has the best bits of Java, Scala,
Groovy, Go, C#, etc…
• Support for command line, IntelliJ, Android and Eclipse,
Emacs (my fave), Gradle
4. Data classes
data class Customer(val name: String, val email: String)
- gives you getters, setters, toString(), equals(), hashCode(), copy(), destructuring methods out of the box
data class Person(val name: String, val age: Int)
val mike = Person(“Mike Harris”, 48)
val youngerMike = mike.copy(age = 21)
val (name, age) = youngerMike
println(“Although $name is older now, he was once $age”)
val mike = Person("Mike Harris", 48)
val youngerMike = mike.copy(age = 21)
val (name, age) = youngerMike
println("Although $name is older now, he was once $age")
12. IDE Support & Learning
• Supported in all versions of IntelliJ IDEA
• Including the Community edition
• Support for conversion from Java to Kotlin, and vice-versa
• Some useful Kotlin Plugins
• Built in courses for JetBrian’s Kotlin Koans and AtomicKotlin Book
• https://play.kotlinlang.org