In this thread I will talk about @duolingo experience in converting their code to 100% @kotlin . All the opinions in this thread are my humble opinions and you are totally free and more than welcomed to discuss any of them in a proper rational and objective way.
Let’s start with @duolingo ‘s blog post about how they discussed that, started, and the results. I will start with the things that I didn’t like, so: 1- Choosing the auto converter as the kick start of 100% Kotlin IMHO is not the best way to do tho.
Usually the auto converter doesn’t deliver the best syntax and as dumb as just converting the current syntax with the equivalent in Kotlin. I know that you added some steps in addition to the auto converter to ensure that you have the best syntax.
But what I am pointing to is reading the whole class well, check its functionality an start thinking how could that be converted? What is the proper way to do the same in Kotlin.
For example, If we have a parent and multiple children classes that doesn’t have a parent initialisations. The auto converter will just convert the whole code as it without introducing the cool sealed class feature. So this is not the best deliver yet.
2- The way you brought the developers into the action wasn’t the best. As It is not always good to start converting the code base the first thing after a presentation or even reading a guide. I believe that creating some simple projects to take your hands in shit is much safer.
By doing tho you ensure getting the knowledge and break the ice to change a code base like Duolingo’s one. What I liked? 1- The concept of there is someone who is experienced in Kotlin reviews the code and start sharing his knowledge across the team during the review process.
2- The steps you did in the commiting as you did it by feature. Usually people start with utils then Activities then View Models etc. but the module thing or the feature thing is much much better. 3- Kotlin tooling is really amazing.
What I gained from reading your blog post? 1- The percentages and statistics. For example stating that converting the code from Java to Kotlin reduced it by 30%. Was totally impressing for me.
2- The intersection between the green line and the red line in the graph shows that changing a big project into Kotlin will be smooth as same as the graph and you will get into so fast.
What I was expecting and didn’t find? 1- More cases of how did you handle errors in converting Java to Kotlin? 2- More statistics like what was easy what was hard in terms of features and syntax. Thanks for this helpful blog post @duolingo and for sharing your experience.