Hello, Is it a bad practise to use get() not exactly as an attribute getter, but as a val inside a companion object ?
Something like this:
class Foo() {
fun method() {
server.start()
}
companion object {
private val server get() = generateANewServer()
}
}
Instead of
class Foo() {
fun method() {
newServer().start()
}
companion object {
private fun newServer() = generateANewServer()
}
}
Thanks!