Hi Kotlin people, is it good to put the companion ...
# android
r
Hi Kotlin people, is it good to put the companion objects to the end for better readability?
v
r
@vyacheslav.gerasimov 👍
m
It's one of the kotlin's conventions.
d
We have this reference for Android too https://android.github.io/kotlin-guides/style.html
p
Not sure about that. If the companion object holds factory methods it makes more sense to me to put them close to the constructor.
r
It depends on your project but keep it consistent. For this I'm more inclined to put them close to the constructor as Paul mentioned.
1
Some of the companion objects I have are helping me to create objects, via factory methods or holding constants for intents, etc...