Kotlin and Android #2  —  Treacherous properties
Sebastiano Poggi
762

When trying to decide between functions and properties, I normally like to refer to the official convention which is actually pretty good:

Prefer a property over a function when the underlying algorithm:
- does not throw
- is cheap to calculate (or caсhed on the first run)
- returns the same result over invocations if the object state hasn’t changed