interface SomeInterface { fun getName(): S...
# announcements
m
interface SomeInterface { fun getName(): String } interface SomeInterface { val name: String } Which is recommended?
p
I would select first approach if it implies that getting a name is not a cheap operation, like it may access some external cache or perform complex calculation. If it is implied that a consumer may get a name as many times as it wants and it will not lead to performance degradation - I would only use the property approach, the second
m
Thanks @Andreas Sinz and @plinyar!