There are a lot of language idioms and features which are not being taken into account during the automated process, though. This page made it clear to me that there’s still a long way ahead. □ Generated code is not always nice to look at ‼️Īfter an initial round of mostly automated migration, I went on to read up on the Kotlin style guide. So, if you don’t have your app tested properly yet, there’s one more reason to do so right here. By having this automated it was a lot quicker and easier to move through the codebase, migrating code as I went along. Without tests, I would have been required to go through the touched features after each change, and manually verify them. This makes them an ideal starting point to set off the journey into a new language.Īfter migrating some of these using the Kotlin code converter, which is built into Android Studio, executing tests and making them pass, I worked my way up until eventually ending up migrating the tests themselves to Kotlin. They are being used throughout the project, yet their complexity is comparatively low. Starting off with the less complex data classes was the clear choice for me. In most cases they are there to provide confidence that changes have not broken existing behaviour. Having a suite of unit and integration tests has many benefits. This way it’s more feasible to maintain a stable application throughout the migration process and learn as you go along. So it’s not necessary to migrate all code to another language.īut if that’s your goal, it makes sense to do so iteratively. Also it’s possible to have both languages within the same project. Kotlin compiles down to Java byte code and the two languages are interoperable. Going step by step is a sensible approach.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |