You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
My vote goes to computed properties so long as they are simple. I came across this blurb from the Kotlin documentation that relates to this, and I think it applies well to Swift too.
Prefer a property over a function when the underlying algorithm:
does not throw
has a O(1) complexity
is cheap to calculate (or caсhed on the first run)
Which is better?
The text was updated successfully, but these errors were encountered: