<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">Swift 2’s access modifiers had a very simple ‘elevator pitch’ -&nbsp;<div class="">“If you are writing code, by default everything within the module (app or library) your are working in can see it, but other modules cannot. If you want other modules to see features of your module, you make them public. If something is an implementation detail that even other parts of your module shouldn’t mess with, you make them private”</div><div class=""><br class=""></div><div class="">I think I would have trouble *just* describing private vs file private in that amount of space. One sign of the complexity was that even after a ridiculous amount of bike shedding, we couldn’t come up with better way to distinguish the two than to call one “fileprivate”. So I would say for the purposes of swift as a language suitable for learning, the change was harmful.&nbsp;</div><div class=""><br class=""></div><div class="">Secondly, there are reasons to choose one versus the other, but the combination of the meaning of the keyword changing between swift 2 and 3 and the spelling of “fileprivate” means that the choice of one or the other doesn’t really communicate anything to a developer of a typical project - it appears to often be a matter of the legacy of the code as well as developer taste. That the choice between private and file private doesn’t illustrate intent is harmful to coordination.</div><div class=""><br class=""></div><div class="">A third point (which is a bit more complex/convoluted) is that fileprivate remained an essential language feature because it allows implementation in extensions, and allows a simple “friend”-like feature where types that need access to implementation details due to higher coupling could be bundled into the same file. Outside of a desire of a scoped ‘private’ simply to match the behavior of certain other languages, private is used to hide implementation details from other parts of a file, while file private exposes them within the file.&nbsp;</div><div class=""><br class=""></div><div class="">There is a potential that file-private can lead to an explosion of complexity due to a large amount of “friendly types” being bundled into the same file. In that sense, ‘private’ was wrong because it was adding complexity at the file level, when really a new access level would possibly have been more productive to define at the at the small-group-of-files level - either via a friend access level or submodules. We still have the potential of unmanageable files due to friend types, but any additional access levels to aid with this problem would have to be weighed against a now significantly more complex access model including file and scoped private. In that sense, the inclusion of scoped private may indeed be harmful in that it increases the challenge of much more useful access levels being added to the language.</div><div class=""><br class=""></div><div class="">-DW</div><div class=""><br class=""><div><blockquote type="cite" class=""><div class="">On Feb 18, 2017, at 11:57 PM, Jose Cheyo Jimenez via swift-evolution &lt;<a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a>&gt; wrote:</div><br class="Apple-interchange-newline"><div class=""><meta http-equiv="Content-Type" content="text/html charset=utf-8" class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">How exactly is the use of scope private harmful?&nbsp;<div class=""><br class=""></div><div class="">Do you have specific examples when scope private was harmful?</div><div class=""><br class=""></div><div class=""><br class=""></div><div class=""><div class=""><div class=""><br class=""><div class=""><blockquote type="cite" class=""><div class="">On Feb 18, 2017, at 9:06 PM, Zach Waldowski via swift-evolution &lt;<a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a>&gt; wrote:</div><br class="Apple-interchange-newline"><div class="">


<title class=""></title>

<div class=""><div style="font-family:Arial;" class="">On Fri, Feb 17, 2017, at 07:52 PM, Jose Cheyo Jimenez via swift-evolution wrote:<br class=""></div>
<blockquote type="cite" class=""><div class=""><p style="margin: 0px 0px 15px;" class=""><span class="size" style="font-size:14px">I don’t think there is evidence that scope private in Swift3 is "actively harmful”.&nbsp;</span><br class=""></p></div>
</blockquote><div style="font-family:Arial;" class=""><br class=""></div>
<div style="font-family:Arial;" class="">This thread would quite simply not exist if not to present exactly that evidence. It exists; we, the change's detractors, exist.<br class=""></div>
<div style="font-family:Arial;" class=""><br class=""></div>
<div class=""><div class=""><font face="arial, sans-serif, sans-serif" class="">Zachary</font></div>
</div>
<div style="font-family:Arial;" class=""><br class=""></div>
</div>

_______________________________________________<br class="">swift-evolution mailing list<br class=""><a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a><br class=""><a href="https://lists.swift.org/mailman/listinfo/swift-evolution" class="">https://lists.swift.org/mailman/listinfo/swift-evolution</a><br class=""></div></blockquote></div><br class=""></div></div></div></div>_______________________________________________<br class="">swift-evolution mailing list<br class=""><a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a><br class="">https://lists.swift.org/mailman/listinfo/swift-evolution<br class=""></div></blockquote></div><br class=""></div></body></html>