<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"></head><body dir="auto"><div></div><div><br></div><div><br>Am 25.03.2016 um 18:36 schrieb Michel Fortin via swift-evolution &lt;<a href="mailto:swift-evolution@swift.org">swift-evolution@swift.org</a>&gt;:<br><br></div><blockquote type="cite"><div>Le 25 mars 2016 à 12:57, Tino Heth via swift-evolution &lt;<a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a>&gt; a écrit :<br class=""><blockquote type="cite" class=""><br class="">afaics this is the third time someone mentions that "file-private" is uncommon — so I think it's&nbsp;time someone dissents:<br class=""></blockquote><div class=""><br class=""></div><div class="">I'll do the same. There's many instances in my code where I rely on the file-private behavior of Swift 2's private. Mostly this happens when I have a pair of coupled classes that are meant to be used together and that need to access internal details of each other. Most declarations can be scope-private without problem, but it's not that uncommon for me to take advantage of file-private.&nbsp;</div></div></blockquote><div><br></div>+1<div><br></div><div><br><blockquote type="cite"><div><div class=""><br class=""></div><div class="">There's another aspect that is bothering me about these long names. It seems that everyone agrees that writing internal is a rare thing. Still, if you look at generated headers in Xcode you'll see internal everywhere, like this:</div><div class=""><br class=""></div><div class=""><div style="margin: 0px; line-height: normal; font-family: 'Source Code Pro';" class=""><span style="font-variant-ligatures: no-common-ligatures; color: #bb2ca2" class="">internal</span><span style="font-variant-ligatures: no-common-ligatures" class=""> </span><span style="font-variant-ligatures: no-common-ligatures; color: #bb2ca2" class="">class</span><span style="font-variant-ligatures: no-common-ligatures" class=""> ItemDataModel {</span></div><div style="margin: 0px; line-height: normal; font-family: 'Source Code Pro';" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">&nbsp; &nbsp; </span><span style="font-variant-ligatures: no-common-ligatures; color: #bb2ca2" class="">internal</span><span style="font-variant-ligatures: no-common-ligatures" class=""> </span><span style="font-variant-ligatures: no-common-ligatures; color: #bb2ca2" class="">var</span><span style="font-variant-ligatures: no-common-ligatures" class=""> storage: </span><span style="font-variant-ligatures: no-common-ligatures; color: #4f8187" class="">ItemStorage</span><span style="font-variant-ligatures: no-common-ligatures" class=""> { get set }</span></div><div style="margin: 0px; line-height: normal; font-family: 'Source Code Pro';" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">&nbsp; &nbsp; </span><span style="font-variant-ligatures: no-common-ligatures; color: #bb2ca2" class="">internal</span><span style="font-variant-ligatures: no-common-ligatures" class=""> </span><span style="font-variant-ligatures: no-common-ligatures; color: #bb2ca2" class="">let</span><span style="font-variant-ligatures: no-common-ligatures" class=""> fileType: </span><span style="font-variant-ligatures: no-common-ligatures; color: #703daa" class="">String</span></div><div style="margin: 0px; line-height: normal; font-family: 'Source Code Pro';" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">&nbsp; &nbsp; </span><span style="font-variant-ligatures: no-common-ligatures; color: #bb2ca2" class="">required</span><span style="font-variant-ligatures: no-common-ligatures" class=""> </span><span style="font-variant-ligatures: no-common-ligatures; color: #bb2ca2" class="">internal</span><span style="font-variant-ligatures: no-common-ligatures" class=""> </span><span style="font-variant-ligatures: no-common-ligatures; color: #bb2ca2" class="">init</span><span style="font-variant-ligatures: no-common-ligatures" class="">(fileType: </span><span style="font-variant-ligatures: no-common-ligatures; color: #703daa" class="">String</span><span style="font-variant-ligatures: no-common-ligatures" class="">, storage: </span><span style="font-variant-ligatures: no-common-ligatures; color: #4f8187" class="">ItemStorage</span><span style="font-variant-ligatures: no-common-ligatures" class=""> = </span><span style="font-variant-ligatures: no-common-ligatures; color: #bb2ca2" class="">default</span><span style="font-variant-ligatures: no-common-ligatures" class="">)</span></div><div style="margin: 0px; line-height: normal; font-family: 'Source Code Pro';" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">}</span></div></div><div class=""><br class=""></div><div class=""><span style="font-variant-ligatures: no-common-ligatures;" class="">Since internal is the default, it's quite common in generated headers. "moduleprivate" wouldn't be an improvement for legibility here. But perhaps no one but me looks at generated headers for my own project.</span></div></div></blockquote><div><br></div>Additionally Jordan noted that there might be a policy to always use explicit access control. In our Java projects we certainly do this because the default "package" level is quite unusual there and omitting it is easily intepreted as being an oversight instead of intentional.</div><div><br></div><div>-Thorsten&nbsp;</div></body></html>