[swift-evolution] Proposal: Re-instate mandatory self for accessing instance properties and functions

Andrey Tarantsov andrey at tarantsov.com
Mon Dec 14 17:13:27 CST 2015


> Note that the `self.property` access in Objective-C was not the preferred design. 
> 
> The first choice was for bare `property` to work. That turned out to be ambiguous too often because of identically-named ivars. Swift doesn't have that problem. 
> 
> The second choice was for bare `property` to access the property, requiring `self->ivar` to access an identically-named ivar. That was not feasible because it was incompatible with too much existing source code. Swift doesn't have that problem either.
> 
> Requiring `self.property` was the third choice.

Greg, these kinds of historical insights alone make 945 unread messages in my inbox worth it. Thank you!

A.



More information about the swift-evolution mailing list