<html><head><meta http-equiv="Content-Type" content="text/html charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div>Proposal link:</div><div><br class=""></div><div><blockquote type="cite" class=""><a href="https://github.com/apple/swift-evolution/blob/master/proposals/0169-improve-interaction-between-private-declarations-and-extensions.md" class="">https://github.com/apple/swift-evolution/blob/master/proposals/0169-improve-interaction-between-private-declarations-and-extensions.md</a><br class=""></blockquote></div><div><br class=""><blockquote type="cite" class=""><div class="">On Apr 6, 2017, at 4:10 PM, Douglas Gregor <<a href="mailto:dgregor@apple.com" class="">dgregor@apple.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><ul class="" style="font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; box-sizing: border-box; padding-left: 2em; margin-top: 0px; margin-bottom: 16px; color: rgb(36, 41, 46); font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol'; font-size: 16px; background-color: rgb(255, 255, 255);"><li class="" style="box-sizing: border-box;">What is your evaluation of the proposal?</li></ul></div></blockquote><div>This proposal is actively harmful. It will push people into using patterns we discourage, like converting between types by using properties or methods on the source type instead of initializers on the destination type. It will cause people to distort their designs, moving implementations into different types solely to gain access to `private` members.</div><div><br class=""></div><div>I don't like scoped `private` either, but at least it has its uses: It's an effective tool when a member has fragile, easily-broken invariants and you want to ensure only carefully-audited code can use it. Type-and-file `private` is not fit for this purpose: Even if you segregate the fragile parts into a separate type, you can just extend that separate type anywhere else in the file and start messing with it. Frankly, I don't think type-and-file `private` is fit for *any* purpose.</div><div><br class=""></div><div>At the same time, type-and-file `private` does not simplify our access modifier scheme, forces people to re-learn what `private` does *again*, and silently removes the protection that people currently rely on scoped `private` to provide without so much as a whimper from the compiler.</div><div><br class=""></div><div>Keeping scoped `private` offers the following virtues:</div><div><br class=""></div><div>* Your code doesn't change meaning or protection</div><div>* You don't have to re-learn what `private` means</div><div>* You can tightly protect fragile parts of a type, completely limiting visibility to one small region of the code</div><div><br class=""></div><div>Making `private` and `fileprivate` aliases for one another offers the following virtues:</div><div><br class=""></div><div>* You will never have to use the ugly `fileprivate` keyword</div><div>* Teaching and explaining access control is simpler</div><div>* You never have to put any piece of code in any particular type</div><div><br class=""></div><div>Giving `private` type-and-file semantics offers the following virtues:</div><div><br class=""></div><div>* You (hopefully) will have to use the ugly `fileprivate` keyword a little less often</div><div><br class=""></div><div>That's it. That's *absurdly* far from being worth it.</div><div><br class=""></div><div>This proposal is the worst of both worlds: weaker encapsulation without simplification, bad incentives without good guarantees, complexity without benefit, change without improvement. It should be rejected.</div><br class=""><blockquote type="cite" class=""><div class=""><ul class="" style="font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; box-sizing: border-box; padding-left: 2em; margin-top: 0px; margin-bottom: 16px; color: rgb(36, 41, 46); font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol'; font-size: 16px; background-color: rgb(255, 255, 255);"><li class="" style="box-sizing: border-box; margin-top: 0.25em;">Is the problem being addressed significant enough to warrant a change to Swift?</li></ul></div></blockquote><div>Access control is a mess, but this proposal does not address the things that make it a mess.</div><br class=""><blockquote type="cite" class=""><div class=""><ul class="" style="font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; box-sizing: border-box; padding-left: 2em; margin-top: 0px; margin-bottom: 16px; color: rgb(36, 41, 46); font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol'; font-size: 16px; background-color: rgb(255, 255, 255);"><li class="" style="box-sizing: border-box; margin-top: 0.25em;">Does this proposal fit well with the feel and direction of Swift?</li></ul></div></blockquote><div>No. This is a direction we have specifically and repeatedly chosen not to go in for many very good reasons. Those reasons still hold.</div><br class=""><blockquote type="cite" class=""><div class=""><ul class="" style="font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; box-sizing: border-box; padding-left: 2em; margin-top: 0px; margin-bottom: 16px; color: rgb(36, 41, 46); font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol'; font-size: 16px; background-color: rgb(255, 255, 255);"><li class="" style="box-sizing: border-box; margin-top: 0.25em;">If you have used other languages or libraries with a similar feature, how do you feel that this proposal compares to those?</li></ul></div></blockquote><div>Swift 2's design was simple and elegant. Swift 3's was irritating but sometimes useful. This proposal keeps the irritation while discarding the usefulness.</div><br class=""><blockquote type="cite" class=""><div class=""><ul class="" style="font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; box-sizing: border-box; padding-left: 2em; margin-top: 0px; margin-bottom: 16px; color: rgb(36, 41, 46); font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol'; font-size: 16px; background-color: rgb(255, 255, 255);"><li class="" style="box-sizing: border-box; margin-top: 0.25em;">How much effort did you put into your review? A glance, a quick reading, or an in-depth study?</li></ul></div></blockquote></div><div class="">Like all of us, I have spent *way* too much time arguing about access control in the last few months.</div><br class=""><div class="">
<span class="Apple-style-span" style="border-collapse: separate; font-variant-ligatures: normal; font-variant-east-asian: normal; font-variant-position: normal; line-height: normal; border-spacing: 0px;"><div class=""><div style="font-size: 12px; " class="">-- </div><div style="font-size: 12px; " class="">Brent Royal-Gordon</div><div style="font-size: 12px; " class="">Architechies</div></div></span>
</div>
<br class=""></body></html>