Kotlin is officially endorsed by Google for Android development but what is all the fuss about? Why should accomplished Java developers care? Here I explore some of the history, fundamentals, and tools that Kotlin provides for Android developers.
5. A Quick History of Kotlin
● Created by JetBrains
○ Creator of IntelliJ, the IDE that powers Android Studio
● First release - July 2011
● Latest release (1.1.3) - June 2017
● Official endorsement by Google as first-class language - May 2017
● 8,000+ total releases on GitHub
6. “We believe Kotlin is an excellent fit for
Android not only because it gives
developers what they want, but also
because it matches the spirit of
Android.”
- Google Developer Product Group
12. “But I’m comfortable and experienced
with Java.”
● That’s great!
● You ultimately have to use what you’re most comfortable with.
● BUT “give it 5 minutes” before reacting.
13. “I don’t want to convert my entire
codebase to a new language.”
● Kotlin can be any percentage of your project.
● Fully compatible with JDK 6.
● 100% interoperable with existing Java code.
14. “I don’t need Kotlin’s special tools to get
the job done.”
● An experienced developer absolutely doesn’t need Kotlin.
● Much can be accomplished with Java.
● BUT barring architectural/performance issues, why would you want
to have less tools available to you?
15. “I’m worried about the performance
implications of using Kotlin.”
● Performance is as good as an equivalent Java application.
● Kotlin lambdas often run faster than the same code written in Java.
● Incremental project builds using Kotlin are usually faster.
17. A Very Small Soapbox
● Don’t let anyone, myself included, make you feel inadequate for choosing a
different programming language or platform than them.
● Will there be better alternatives to what you use? Yes.
● Does that mean the service you provide to your users is sub-par? No.
● Is it okay to have differing opinions about certain technologies? Absolutely.
● Important to be supportive.
20. Setting Up Kotlin in Android Studio
● Extremely easy setup for both major versions of AS
● Plugin for AS 2.3.X
○ Preferences > Plugins > Install JetBrains Plugin
● Baked-in support in AS 3.0.0 (beta)
○ Also includes:
■ A new profiler tool
■ A network/request analyzer (!)
41. Drawbacks To Kotlin
● It’s new
○ Initial development with Kotlin will be slower
○ Code patterns/anti-patterns not fully flushed out yet
● Java has more robust static analysis tools
● Much smaller developer community than Java’s
● Adds ~727kB to the total size of your project
42. Over time the benefits
of using Kotlin will
continue to grow.