[swift-evolution] final + lazy + fileprivate modifiers

William Sumner prestonsumner at me.com
Mon Feb 13 12:26:32 CST 2017


> On Feb 12, 2017, at 9:19 AM, David Hart via swift-evolution <swift-evolution at swift.org> wrote:
> 
> 
> Fileprivate 
> 
> I started the discussion early during the Swift 4 timeframe that I regret the change in Swift 3 which introduced a scoped private keyword. For me, it's not worth the increase in complexity in access modifiers. I was very happy with the file-scope of Swift pre-3. When discussing that, Chris Latner mentioned we'd have to wait for Phase 2 to re-discuss it and also show proof that people mostly used 'fileprivate' and not the new 'private' modifier as proof if we want the proposal to have any weight. Does anybody have a good idea for compiling stats from GitHub on this subject? First of all, I've always found the GitHub Search quite bad and don't know how much it can be trusted. Secondly, because 'private' in Swift 2 and 3 have different meanings, a simple textual search might get us wrong results if we don't find a way to filter on Swift 3 code.

I find the “Motivation” section of SE-0025 convincing. Private/fileprivate allows for distinguishing between shared and hidden details among related code in a file. Not only is there benefit in knowing intent when reading, but there is also benefit in writing because the IDE won’t autocomplete hidden details. I work on large files I’m not the sole author of, so this is important to me.

Preston
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-evolution/attachments/20170213/84d52371/attachment.html>


More information about the swift-evolution mailing list