Hi, I've read this: <https://medium.com/@BladeCode...
# announcements
c
Hi, I've read this: https://medium.com/@BladeCoder/exploring-kotlins-hidden-costs-part-1-fbb9935d9b62 and have a question about using companion objects. I feel that there is a prevailing opinion that instead of Java's
static final
in Kotlin
companion object{ val /* or const val */ }
should be used. At least I have seen a lot of people doing that. But if your class will only have one instance (e.g.
@Singleton
or
@Component
appropriately scoped), then this is superfluous and you can (and probably should) use simple class-level `val`s without wrapping them in an object. Am I missing something?
1