When using delegation - should I use a function or a property?


If I have a class that delegates some work to another class, does it matter if I use a function:

fun isEmpty() = delegatee.isEmpty()

or a property

val isEmpty
  get() = delegatee.isEmpty()


Thank you – Randy


No, it does not matter. Also, consider Kotlin's built-in capability for delegation.