Ben Dale and Max discuss the adoption of Kotlin at lastminute.com, which began in late 2018 for both server-side and Android development.
The main benefits lastminute.com have found from using Kotlin are its functional style programming capabilities, reduction in lines of code with no change to programming styles, and improved developer experience. Barriers experienced include compiler speed when using TDD practices, as well as a lack of ID support compared to Java.
Lastminute.com use Spring Boot as its framework due to legacy applications already running on it but they are starting to experiment with co-routines. Max discussed the progress of moving to Kotlin for JVM applications, noting that it may take an average developer a month to become proficient in the language.
Ben:
When did lastminute.com start to use Kotlin?
Max:
We started in late 2018, mostly for server-side development and for Android development, of course, when Google adopted it first.
Ben:
Did you adopt the language for of both server-side and android at the same time, or did one come before the other?
Max:
When Google made Kotlin a first-class language, it was a natural progression because both languages were quite similar in syntax and developer experience.
We were looking for a tool that was more suited for us for implementing functional programming but we were reluctant to use Scala, which was the only option five years ago.
We decided to get full steam on Kotlin, and in the end, proved to be a very successful choice.
Ben:
You said you didn't want to use Scala and opted for Kotlin instead. Can you provide more context on why you made that decision?
Max:
There were mainly two reasons.
Scala was quite fragmented in terms of it having different communities and some were quite temperamental, the Kotlin community has proven much more inclusive in terms of communication with people that join this world for the first time.
Secondly, we have always good support from our standard IDE. At that point, we moved out from being just let's say a single company project to a wider one.
Ben:
What are the other key benefits that you've found from using Kotlin?
Max:
The possibility to implement somewhat functional style programming languages, there is an ecosystem that also allows you to do functional programming. It has been one of the most appreciative features of the code.
The same code written with Java, when converting to Kotlin was approximately 30% of the original lines of code.
This is very important for us because there is less code to maintain, meaning fewer bugs and a more productive approach to more focus on the business rather than the ceremonies of the languages.
Ben:
What applications are you using Kotlin for?
Max:
We are mostly creating a backend application. We have a microservice architecture, with 150 more or fewer services in production. At least one-third of those are written in Kotlin or contain a significant amount of Kotlin in a source code basis. We use it mostly for everything that requires Java.
Ben:
Are there any barriers to adopting Kotlin?
Max:
The first one is the compiler speed since most of our developers were using TDD practices. So, they compile feedback. The feedback cycle is important and the speed of having things compiled and tested is vital.
Kotlin has added a significant overhead in terms of computational speed. Mostly it doubled the compiled time, especially on larger core base, and this was the main barrier for some teams to adopt it.
Ben:
What framework or frameworks do you use with Kotlin and why?
Max:
We are using a customized version of Spring Boot.
We haven't tested things like Ktor, we are starting to experiment a little bit more with co-routines but we are quite happy with Spring Boot.
Ben:
When you made the decision to work with Spring Boot, did you consider other frameworks as well, or was it kind of just a no-brainer to use?
Max:
It was a no-brainer because we're coming from a legacy, we were using Spring Framework as a foundation for that application. And there were no significant major alternatives at the time, around 2015.
Ben:
When you make a hire within the team, do you hire developers no prior Kotlin experience?
Max:
Our main language is still Java. So, we require proficiency in Java and then with the option to learn Kotlin, and Kotlin is considered as a plus.
There is a discussion on progress, and whether to move to have Kotlin as a main language for JVM applications across the business.
Ben:
And how long, in your experience, on average, would you say it takes an engineer, with Java experience to become proficient in Kotlin?
Max:
It depends on what you mean by proficient. It's easy to start with the basics and to write decent Kotlin code.
In one month, an average developer can write and read without too much assistance to, say, Kotlin code that uses the same basic function.
Kotlin is quite simple as a language. To master more advanced features, you need a little bit more knowledge, and you need also to work on a project that requires it.
I think it's a great language, a great tool. It's very productive. I love it. I really hope that the Kotlin space will broaden and continue to grow.
Thank you for joining us, Max. It was great to hear your story and how lastminute.com have adapted to using Kotlin as a main programming language.