Is it actually a good practice to use Singleton pa...
# kontributors
e
Is it actually a good practice to use Singleton pattern in Kotlin? If yes, will there be more convenient methods of creating Singletons? Because
Copy code
private object Holder { val INSTANCE }
companion object { instance: ClassName by lazy { Holder.INSTANCE } }
Is kinda irritating to write and read.
g
Why not just
object MySingleton
? It’s standard Kotlin way to create thread safe singletons with syntactic sugar accessors
Also not sure that this somehow related to this channel