Open wnagrodzki opened 6 years ago
I think this needs to be more specific about “work to be done”. Swift API design guidelines suggest using algorithmic complexity, i.e. they imply that computed properties that aren’t O(1) should be documented as such.
In general, methods represent actions and properties represent data. Properties are meant to be used like fields, meaning that properties should not be computationally complex or produce side effects. When it does not violate the following guidelines, consider using a property, rather than a method. Source MSDN