[swift-evolution] private & fileprivate

Kevin Ballard kevin at sb.org
Thu Oct 13 16:14:46 CDT 2016

On Sat, Oct 8, 2016, at 07:42 AM, Anton Zhilin via swift-evolution wrote:
> As far as I can see, almost all people, who talk here, agree that
> private / fileprivate distinction brought more harm than good. Despite
> corresponding proposal being accepted.
> I think, it means that current mailing-list system is failing. Let's
> accept it, gmane looks and feels ugly by comparison to forums. And
> using email limits the number of people involved by an order of
> magnitude.
> What we need is popularization of SE, reaching as many developers as
> we can, using simple voting, likes, and so on.

This is a bad conclusion. Discussions like this naturally attract people
who are unhappy with the status quo. So it's no surprise that you're
seeing a lot of people say they don't like private. Personally, I *love*
having the new private and I use it almost everywhere. It's very rare
for me to write fileprivate and when I do, it's an intentional decision.
And the only reason I even saw this thread is because someone linked it
to me on Slack.

-Kevin Ballard

> 2016-10-08 12:31 GMT+03:00 Haravikk via swift-evolution <swift-
> evolution at swift.org>:
>> > On 7 Oct 2016, at 22:44, Tony Allevato via swift-evolution <swift-
>> > evolution at swift.org> wrote:
>>  > personally I thought `private` was fine the way it was when it
>>  > meant `fileprivate` and I had no real need for `private` as it
>>  > exists in Swift 3.
>> I have to agree with this; I wasn't especially comfortable with the
>> change (or the eventual choice of keyword style) and in practice I
>> just don't find it useful. I haven't used the new "private" even once
>> since it was added, except by accident, the only form of private I
>> use is fileprivate.
>>  I've happily embraced the conform through extension style in Swift,
>>  and really when it comes down to it the new private access level
>>  just isn't compatible with that style of development. It's only
>>  really useful for hiding details of something you add in one
>>  specific section, which I almost never do (and when I do I just mark
>>  it fileprivate in case I can re-use it).
>>  Maybe some people do find it useful, but I'd prefer fileprivate to
>>  be the default behaviour of private; the current (scoped?) private
>>  access level seems far more limited, thus more deserving of a less
>>  convenient keyword, or some kind of modifier on private. But
>>  personally I'd be fine with removing it, as I don't think it really
>>  adds anything that fileprivate doesn't already cover.
> _________________________________________________
> swift-evolution mailing list
> swift-evolution at swift.org
> https://lists.swift.org/mailman/listinfo/swift-evolution
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-evolution/attachments/20161013/0c828113/attachment.html>

More information about the swift-evolution mailing list