hey - guys so we are beginning to refactor a LARGE...
# android
s
hey - guys so we are beginning to refactor a LARGE project into kotlin. Wanted to ask general rules of thumb for 3 things : RxJava, Dagger and Architecture Components. Do you guys use them in the Kotlin world, or is there something built-in that's a better/idiomatic alternative ?
🎖️ 1
b
Yes, we use all 3 for a pure Kotlin app. RxJava + RxKotlin (extensions/helpers for RxJava)
2
k
All 3 of those are still valuable in Kotlin. I use all 3 in all of my work in Kotlin
and we use 2 of those 3 at work in our app with mixed Kotlin + a ton of Java. Still trying to convince everyone to get onboard the Dagger train...
k
you should try Databinding library too
b
Yeah, databinding can be great -- just be careful that you are not putting too much logic in your XML. It can get out of hand really quickly if you aren't careful (and a nightmare for others to maintain)
a
Why did you decide to refactor your project into kotlin?
😱 1
s
@Artem Ohanjanyan well we have loved kotlin for a long time ! (I have a proposal on kotlin scripting as well). But we have a large exisiting codebase, so was waiting for Google support - now that its here, have been planning this out.
a
Kotlin seems to have good interop with Java
k
Yeah, I wouldn't refactor a codebase to use Kotlin; one of the best parts of Kotlin is the interop. Our app would have taken months just to rewrite in Kotlin. The only reason we were able to start using it is because we were able to drop it in alongside the rest of the code. Even after almost a year of using Kotlin, we're only at 11.8% Kotlin, with 85.9% still Java apparently
d
rxjava - coroutines+kotlin stdlib dagger - kodein
btw, migrating from dagger2 to kodein decreased build times twice!
k
of course it did, now you're doing less at compile-time and more at runtime 😆
IMO it's still nice to have RxJava over coroutines because the API is common and standard (reactive streams) so other libs will implement them in a way that makes it easy for you to consume
d
what other libs? with coroutines you can use any lib you want. because there are no specific api requirements
k
I mean that more libs have adapter layers. Architecture Components, Room, Retrofit, etc, all have dependencies you can add that give you Observable wrappers around their classes