[swift-evolution] [Review] Require self for accessing instance members

David Owens II david at owensd.io
Fri Dec 18 01:54:07 CST 2015


* What is your evaluation of the proposal?

+1.

* Is the problem being addressed significant enough to warrant a change to Swift?

Yes. I believe that is much clarity lost. I also really dislike the inconsistent requirement of self in multiple contexts. When we talk about language rules, I really think it’s a disservice when there needs to be a lot of qualifiers. You use “self” in this context, but you don’t have to in this one, well, unless you then do that… This kind of explanation, in my opinion, signals a design flaw.

I’ve never encountered a bug in a language that requires self to access its members with shadowing, but I have had the opposite experience many, many times. While this doesn’t fix all shadowing issues, I do think it fixes the vast majority of them.

* Does this proposal fit well with the feel and direction of Swift?

Yes.

* If you have you used other languages or libraries with a similar feature, how do you feel that this proposal compares to those?

I’ve used languages on both sides. Most recently, I’ve been working with TypeScript. I don’t know the language well (at all really), it requires self for member access. I have to say, it’s really been a help for understanding what is where.

* How much effort did you put into your review? A glance, a quick reading, or an in-depth study?

I’ve read through the threads and proposal and experience from languages that don’t require this and do.

-David



More information about the swift-evolution mailing list