Google has already expressed several times that they don’t have anything against Kotlin, and that they’re not preventing us from using it while the compiler still generates valid bytecode.
But many people is still waiting for an official support, something that could never happen.
While we wait until that moment though, I thought it would be nice to know what the Google Developers Experts for Android think about it.
If you hadn’t heard about it, Google Developers Experts (GDEs) is a program that recognizes outstanding developers the effort to be a reference on the field they are involved in.
I contacted some of these Android Experts (the list is huge!), and I got answers from 17 of them. Thanks a lot for being so nice and taking your time to answer!
I’ve just asked them to tell us a bit about them, and what they think about Kotlin. The answers are obviously unmodified, so you will find voices for and against (or not so for) the language.
I really hope this helps you form an idea of how Kotlin is being a game changer, and that, at least, is a language to take into account if you are an Android developer.
Without further delay, here it is the opinion of our GDEs in no particular order:
1. Annyce Davis
Annyce is an Android Google Developer Expert. She has spent the past 6 years developing applications for the Android ecosystem across multiple form factors.
She is also an international conference speaker and author, sharing her knowledge of Android development with others.
I used to develop Grails applications which used Groovy as the programming language. Groovy was a huge improvement over Java to me. It was concise and helped avoid much of the boilerplate that I had to come expect when coding in Java 6 at the time. When Kotlin came on the scene I was immediately intrigued as much of the syntax reminded me of Groovy. It was both clean and concise.
I’m an avid learner, so I was eager to learn about Kotlin and began by playing around with the Kotlin Koans. I also ordered an Early Access version of the Kotlin in Action book. The thing that pushed me over the edge was listening to the Kotlin podcast with Hadi. I decided to finally become serious about Kotlin with the 1.1 release and add it to my production application.
It has lots of advantages for Android developers. The single most obvious benefit is the Type System and the way it handles Nullability. This forces you into indicating which variables can be null and then developing accordingly. The compiler then steps in and enforces that the assigned arguments are always valid. Null Pointer Exceptions are the single most type of exception that I deal with in my Android applications. Kotlin helps to level the playing field.
The next huge win, in my opinion is the ability to have Extension Functions. The ability to add methods to the Context, Activity, and Date classes has cleaned up my code a lot, and made it more readable.
By using Kotlin, my code is simply better for it.Kotlin has lots of advantages for #AndroiDev. By using #Kotlin, my code is simply better for it. Click To Tweet
2. Sebastiano Poggi
Emerging from the foggy plains of northern Italy after working at a smartwatch startup, Sebastiano moved with his curls to London to do great things.
Regularly speaking at conferences and brain-dumping on the ‘net got him into the Google Developer Expert programme in 2014. Nowadays he’s obsessing over UI and UX and coding some rather cool apps at Novoda.
I really, really like it as a language. I personally feel it makes coding a pleasure in many cases where it would be a painful, tedious thing in Java. I am by no means an expert, because I haven’t gotten to use it on a daily basis at work yet, but I do use it whenever I do some side project. You know the legendary 10x developer? Kotlin sometimes makes me feel like I’m a 10x developer (I don’t think anyone can be a 10x developer all the time, so that’s a great start for me).
Aside from the obvious benefits of the language terse syntax, I am really appreciating all the additional APIs and the ecosystem that is building around it. For example, immutable collections are something that I feel the need for very often but, short of having (part of?) Guava in an app, you can’t really get with Java; Kotlin has a first party implementation. And this goes for a bunch of things. Oh, did I say I’m really excited to see what happens when they release the support for LLVM as a target?
As I mentioned, though, my day-to-day work does not include Kotlin. While there are reasons why it could greatly benefit from it, this project is also a tough one to have Kotlin on, since its big team size is excruciating the main problems I see with kotlin: the sore lack of static analysis tools, and the lack of established design patterns.
The latter is a relatively minor problem if your project is not that big or complicated, but on a huge codebase with ten devs working on it and a legacy of almost ten years, having well established patterns is the anchor for your sanity. Sure, you can use Java patterns, but not all of those really make sense in Kotlin as several of those were designed to work around Java limitations. This is a very long discussion, I’ll cut it here lest I take up the whole post 😀
The former problem is, to me, the most critical one and the thing that is really a showstopper. The fact you in practice cannot use PMD, Checkstyle, Findbugs and other tools (have not tried Errorprone) makes it for a very risky situation. For one, if you have more than 3-4 devs, you cannot expect a tight oversight on code style. More importantly, you lack a lot of in-depth bug checking you get from those tools. Raise your hand if you never had your buttons saved by static analysis (used correctly). I don’t believe you! Now, I know there are the IDE inspections, but those are not even remotely as powerful (yet); and there are a couple of projects to bring static analysis to Kotlin, but they are not there yet to be something you can depend on. I am really looking forward to seeing them become mature enough that we can finally use them with confidence!
In the meantime, I’m using Kotlin on smaller codebases and loving it 🙂You know the legendary 10x developer? #Kotlin sometimes makes me feel like I'm a 10x developer Click To Tweet
3. Jorge Barroso
Jorge Barroso is the co-founder and Android developer of Karumi. an intentionally small software development studio headquartered in Madrid and specialized in developing lean and stable native applications and working with teams for improve their skills.
With over 10 years of software engineering experience Jorge defines himself as a pragmatic coder who thrives to improve the Android project architecture by being a firm advocate of the concept of semantic code and test development. He is continuously learning and honing his Android coding skills in an effort to understand and adapt to the evolution and of the internal framework.
Kotlin is a giant step forward in Android development. Android was missing something like that, compared to the rest of Java platforms it has been a bit outdated, even with the java 8 push, it does not end up being the modern language that we’d all like.
The biggest problem I see right now is the implantation, it’s difficult to convince a company to turn to Kotlin and show them the value. It is simpler in technological companies because it is an incentive and a challenge for its developers, but it is more difficult for smaller companies. In addition, there’s the fear of many companies of Google not being behind pushing, which makes it not finish taking off completely.
I like the language and how it contributes to the ecosystem, I would like to be able to use it more in my day to day life, but the nature of the projects I work with will not allow this. I encourage anyone to take a look, but either kotlin or another language, because this will give them another vision and a very useful learning when writing software.#Kotlin is a giant step forward in #AndroidDev. I like how it contributes to the ecosystem Click To Tweet
4. Donn Felker
5. Mark Allison
While there is much to like about Kotlin, I do not feel that it is mature enough to use for production projects. The lack of established patterns and best practise for Kotlin is likely to result in code which is difficult to maintain.
This is reflected in the lack of static analysis tools for Kotlin. While the Java static analysis tools are not perfect, they can be a good indicator of technical debt. The Java tools will not work with Kotlin because they specifically analyse the Java source.I do not feel that #Kotlin is mature enough to use for #AndroidDev production projects Click To Tweet
6. Huyen Tue Dao
I am absolutely crazy about Kotlin (would that be “krazy?”). At work we’re just 100% on the Kotlin train and yes, that includes production code! In fact, I write only in Kotlin wherever and whenever I can get away with it, and because of the Java interoperability that’s been pretty much everywhere. I can lean on and access the platform APIs as well as other existing code and libraries while still enjoying and leveraging all of the great modern language features of Kotlin.
Because Kotlin is new and because we all are in the process of discovering and defining best practices, I am forced to closely examine the impacts of every line of code at both a high and low level. And that’s just fun and forcing me to be more deliberate and conscientious of certain decisions.
And the conciseness of the language is amazing. I love Android but we do deal with a lot of boilerplate, and Kotlin helps cut that down a bit. While too much conciseness can be a readability problem, I think most of the time Kotlin actually improves the readability as long as we all don’t go too crazy and keep in mind what we want our best practices to be.At work we're just 100% on the #Kotlin train and yes, that includes #AndroidDev production code! Click To Tweet
7. Dmytro Danylyk
Kotlin is a real game changer for those who stuck in android world. There are tons of my favorite features like: null safety, data classes, properties, lazy properties, extension functions, coroutines, immutability and much much more.
I enjoy writing in Kotlin because I don’t have to use a lot of 3d party libraries, Kotlin already provide most of the things out of the box.
Thanks to JetBrains we have awesome IDE support and tons of learning materials, even online REPL.I enjoy writing in #Kotlin because I don't have to use a lot of #AndroidDev 3rd party libraries Click To Tweet
8. Anup Cowkur
Anup is a Google developer expert for Android, Android tech lead for ride hailing products at GO-JEK.
Speaker at Droidcon India, Stockholm, etc. Author of various android articles, Organizer of Bangalore Android User Group.
I used to program in languages like Haskell and Elixir and think, “Why can’t we have nice things on Android?”
And now with Kotlin, we can.
Optional types baked into the type system, first class functions, pattern matching (sort of) and immutable types let me finally do some real FP on Android.#Kotlin features let me finally do some real FP on #AndroidDev Click To Tweet
9. David Vávra
I use Kotlin in production for my main app (Settle Up). It’s mature enough and has many advantages over Java (any version really). It’s fully compatible with existing Java tools and libraries, works great with Android Studio.
If I was starting a new app, I would definitely start writing it in Kotlin. Common counter-argument is: “But my teammates who don’t know it already will complain and will be less productive”. I disagree, switching from Java really doesn’t take much effort. And the advantages show really early in the process. For example starting to use RxJava is much, much harder.
For migrating existing apps – it depends. You can write just one screen in Kotlin for example, but to take advantage of the language it’s better to switch 100%. And that could be hard to justify to the project owners.
The only thing that Kotlin needs is an official “stamp of approval” from Google. Google doesn’t have to do anything else, except maybe add Kotlin version of snippets in the documentation (like they do for Swift/ObjectiveC). If that happened, we would see a major adoption of Kotlin. Fingers crossed for this year’s I/O!I use #Kotlin in production for my main app @settle_up. It's mature enough and has many advantages Click To Tweet
10. César Valiente
I think Kotlin is an awesome modern programming language.
Its learning curve is really small, you can have a look one day during the morning and at the end of the day you will probably know how to code some stuff.
Is really enjoyable, is fun to use, it is concise, it has features that other modern languages have, it’s on continuous development by a really skilled team as JetBrains is, together with the support of the community since, yes, Kotlin is Open Source!
I’m not going to spend time explaining features that Kotlin has and that makes our developer lives better, for that, you can have a look to the really good documentation, for practicing you have Koans that can be done in our IDE or in the web and the community is continuously publishing new and amazing content.
On Android, Kotlin gives us, Android developers, a fresh air, a new reason for enjoying making apps, with Kotlin you write less code, that at the end of the day is really important, your code is nicer to read, it has less boiler plate, you become more productive since you spend less time writing same stuff again and again, and as I said before, with Kotlin you will have fun!
A question that is always in the air, at least in the Android community, is: is Kotlin production ready? My answer… of course it is, JetBrains released the stable version 1.0 last year.
Do you think that if had not been ready for production the smart guys at JetBrains would have released it? of course not. They use in some of their products and other great and recognised companies use Kotlin in production as well.
Ok, ok, everything sounds good here, it should have something not-as-good, right? yes, one of the things the community is waiting anxious is tooling. Static analysis tools are really important when you work on a team.
We have some lack of them still on Kotlin, of course you can do essential stuff like build, running tests, etc. but tools like checkstyle, pmd, findbugs, etc. that coming from Java are extremely important, still are not available on Kotlin (ok, we have the internal code analysis in IntelliJ but this is not enough though).
So yeah, if you work on a big team, and static analysis tools are really important in your daily basis (they should be), you should think about this a little bit more.
If you work on a small team, that you can keep control of “everything” go ahead!
As conclusion, I would like to say that Kotlin is great, you will have lots of fun and you will be more productive using Kotlin (at least coming from the tuple Java-Android), you we still have some issues regarding static analysis tools, but if you can survive without that, go ahead, give it a try and you will love it! 😉On Android, #Kotlin gives us #AndroidDev a fresh air, a new reason for enjoying making apps Click To Tweet
11. Nelson Glauber
Nelson is Senior Android Developer at Mokriya and professor of mobile development in post-graduation and extension courses in the Northeast of Brazil. In 2014, Google nominated him the first Developer Expert of Android in Latin America. In 2015, he joined in Intel Innovator program.
He has also spoken at various regional and national events and has written about mobile development in his personal blog and for specialised magazines. He is the author of the book “Mastering Android: from basic to advanced” (in Portuguese) released January 2015.
Kotlin is an impressive language. The language features are amazing and remove a bunch of the boilerplate required by Java language. Not to mention the fact of vast majority of libraries on the market (and written in Java) are full compatible with Kotlin. Another thing to make easy the language adoption is the compatibility with Android Studio which is excellent and stable.
The learning curve is quite low for Java/Android developers (but might not be for novices). I’ve start to learn Kotlin last year by reading the Antonio’s book (which is very good, by the way) and since then, I’ve been using language in all my personal projects and lectures.
Unfortunately I haven’t had the opportunity to use it in production yet, but I have no doubt that the language is ready and mature enough to be used effectively in large projects.
In my opinion the only reason to don’t use the language is that once you start programming in Kotlin, you no longer want to use Java anymore 🙂Once you start programming in #Kotlin, you no longer want to use Java anymore #AndroidDev Click To Tweet
12. Ryan Harter
About a year ago I started writing all new code in Kotlin. After some experimentation, I found that it was stable and several features of the language provided enough benefit to make the switch. Due to it’s Java interoperability, anything that I couldn’t figure out in Kotlin I could simply fall back to Java for.
The biggest, albeit simple, language feature that really simplifies my workflow is extension functions. In my graphics work, I end up doing a lot of math and matrices, meaning lots of utility classes. Extension functions have cleaned this up tremendously and make my code more concise. That mixed with functional programming support makes for a truly enjoyable workflow.
My biggest recommendation to developers considering making the switch is to remember that Kotlin isn’t all or nothing. It works well with existing Java code, so you can dip your toes in the water and take things a step at a time.The biggest #Kotlin feature that really simplifies my my graphics work is extension functions Click To Tweet
13. Ubiratan Soares
Kotlin is the future of Android from a developer experience perspective. Period.
Kotlin is doing for Android development much the same as Gradle did three years ago; as Android-developers community, we should embrace Kotlin, spread Kotlin, and empower Kotlin with a huge critical mass of developers, because we deserve better ways to develop our apps, satisfy ours customer needs and perform well at our jobs.As #AndroidDev we should embrace,spread and empower #Kotlin with a critical mass of developers Click To Tweet
14. Philippe Breault
Kotlin is a breath of fresh air for Android developers.
I love the work that has been done on lambda expressions. Being able to let the compiler inline lambdas, when it makes sense, allows us, android devs, to use them in tight loops where we would usually avoid instantiating new objects.
It’s also the simple things that matter: no semicolons, not having to type a variable’s type twice if you assign it on the same line, properties instead of getters/setters, etc. It makes reading code a lot easier.
The only thing that I hope will be improved is the interoperability between the Android Gradle plugin and the Kotlin plugin. Right now, If you try to stay on the bleeding edge on both sides , it can break every once in while.
That being said, Every android developer should keep an eye on this language or, even better, try it!Every #Android should keep an eye on #Kotlin or, even better, try it! Click To Tweet
15. Iñaki Villar
Kotlin is bringing new cool concepts at the Android Platform. It’s not only about writing classes/activities with another language.
At this moment we are porting our Automation framework to Kotlin, we are enjoying how declarative can be the process to define our own DSL and let developers and QA write test more fluently.#Kotlin brings new cool concepts to #AndroidDev. It's not about writing classes in another language. Click To Tweet
16. Dan Lew
Kotlin enables more concise and understandable code than Java without sacrificing performance or safety. Kotlin compiles to bytecode, so it can perform just as well as Java. It’s got the same compile-time checks as Java (and more, such as built-in nullability checks). And most importantly, Kotlin’s language features and standard library functions enable succinct, effective code.
Moreoever, the ecosystem around Kotlin is strong. Naturally, the tools support from JetBrains is good. In addition to that, the language is actively being supported and improved. JetBrains isn’t breaking Kotlin every time they update it, either. And Kotlin plays along nicely with Java, which makes the transition from Java to Kotlin easy.
Finally, as an Android developer, there’s another important reason for my preferences: Kotlin can be updated independently from the OS. Since Java capabilities are tied to the Android OS, you often miss out on new language features and standard library APIs. By comparison, you can start using any new Kotlin features the moment that they’re released.#Kotlin enables more concise and understandable code without sacrificing performance or safety Click To Tweet
17. Enrique López Mañas
I started developing for Android as a natural evolution from being a Java guy. The language was shared, so I decided to give it a try. And it was a choice full of sense at the time. In my personal case, this kick-off moment was in 2009.
Java was born in 1995. Since then a few versions have been published, increasing and improving its initial features, being the current version Java 8. Java was designed 22 years ago, which is an eternity considering how technology evolves, and it has currently a few flags hard to ignore. As a developer, I always experimented with other languages. The most noticeable example of a language solving some of the Java flags was Scala. The inflection point was when I saw a language like Swift in action. I do also code for iOS, and noticing how Swift was overcoming obvious problems such as nullability open my eyes on the holes in Java I had always ignored.
Due to its nature, Android natively supports all Java 7 features but only a subset of the ones present in Java 8, This supposes rather a deceleration in how the Android ecosystem can cope with other platforms. And Kotlin here is helping to fill the void.
Kotlin is a modern language (the version 1.0 was released as recently as February 2016). Its original aim was to supply the deficiencies of Java, as Scala does, but solving some of the present issues (for instance, the compiling time). JetBrains is doing an amazing job at it, and the compilation times have improved astonishingly in the last versions. As a newcomer into Kotlin, these are the answers to the questions I initially had in mind:
– Interoperability with Java: Kotlin can directly interact with Java classes and the other way around. That was a basic point: I did want to reuse my codebase and adapt it into Kotlin.
– Conversion tools: although the automatic conversion of Java to Kotlin is not to be trusted blindly, it makes a really damn good job. When I am converting Java classes, I think I can easily reuse 60%-70% of the resulting code. My approach is not to convert an entire codebase from Java to Kotlin overnight, but doing it following little steps. And the revision time after applying the automatic conversion is minimal.
Coming to Kotlin itself, it was great to experiment with something fresh after developing many years with Java. If you are a Java developer, the syntax of Kotlin comes very naturally. If you are a Swift developer it will happen the same, and you will have the benefit of understanding a few key concepts such as Nullability. The features that grabbed my attention more from Kotlin were the following:
– Nullability: telling your business that you can avoid 2/3 of your exceptions in productions is appealing. And you do not know how of a mess this is is Java until you start using Kotlin.
– Functional programming: yes, Kotlin supports functional programming, as Scala does.
– Default and named arguments: again, if you have not tried something before you can’t miss something. In Kotlin you can set up a default value for a parameter in a function, and give a name to each of them. This just increases legibility and readability of the code exponentially.
– Smart casting: tired of using instanceof and then casting the object? It always seemed to be something very redundant that could have been easily prevented. Kotlin does this automatically for you.
There are a bunch of things in Kotlin that would take a few articles to enumerate and dive in. Summarizing: Kotlin is a language that comes to supply and improve some of the Java scarcities. The learning curve is very gentle for Java developers. It is not an EITHER/OR type of question, since you can use both languages in your Java base. Kotlin will increase your productivity, and make you a better programmer in the medium and long term.#Kotlin will increase your productivity, and make you a better programmer in the medium and long… Click To Tweet
What’s your opinion about Kotlin?
Have you played with the language? Are you using it for or own projects or even in production?
You can also tell your story in the comments section.
Author: Antonio Leiva
I’m in love with Kotlin. I’ve been learning about it for a couple of years, applying it to Android and digesting all this knowledge so that you can learn it with no effort.