[swift-evolution] [Review] SE-0023 API Design Guidelines (when to use properties)
howard.lovatt at gmail.com
Wed Jan 27 22:44:24 CST 2016
Yes. Better wording would be no externally visible mutation.
On Thursday, 28 January 2016, David Waite <david at alkaline-solutions.com>
> > On Jan 27, 2016, at 1:56 PM, Howard Lovatt <howard.lovatt at gmail.com
> > I would say that if it doesn't have arguments and doesn't mutate then it
> should be a property, since it will read better and is flexible (you can
> switch between a stored and calculated property without affecting the
> external interface easily).
> It can mutate as long as the mutation is not externally visible on that
> interface. An example of this would be if the implementation of Set were
> internally backed by a Splay Tree, where balancing of the tree happens on
> every access.
> Another example is any computed property ever which output logging.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the swift-evolution