[swift-evolution] [swift-evolution-announce] [Review] SE-0159: Fix Private Access Levels

Shawn Erickson shawnce at gmail.com
Mon Mar 20 22:42:04 CDT 2017


I am still on the -1 side of this. I leverage the swift 3 enhanced
encapsulation aspects of private fairly heavily and would rather see any
additional efforts take place on needs of exposing things for subclasses to
work with while hiding them from clients of those classes (better then
protected like thing), submodules and things related. Also I would like to
avoid forcing file organization on folks to control access to things if it
can be done sensibly in other ways.

I don't see strong enough supportive reasoning in this proposal to warrant
a change nor does aspect of the talk about it being harmful, etc. The
default is internal, if you have no care for access controls just omit it
and things will work great for new users, etc of swift. If you want things
to be restricted for better encapsulation (or limiting auto completion) use
private. If you find a need to relax thing some consider fileprivate.

-Shawn

On Mon, Mar 20, 2017 at 8:26 PM Charles Srstka via swift-evolution <
swift-evolution at swift.org> wrote:

On Mar 20, 2017, at 9:33 PM, Greg Parker via swift-evolution <
swift-evolution at swift.org> wrote:



On Mar 20, 2017, at 4:54 PM, Douglas Gregor <dgregor at apple.com> wrote:

Hello Swift community,

The review of SE-0159 "Fix Private Access Levels" begins now and runs
through March 27, 2017. The proposal is available here:

https://github.com/apple/swift-evolution/blob/master/proposals/0159-fix-private-access-levels.md

-1. I yield the remainder of my time to Drew Crawford who satisfactorily
explained my concerns.


I’ll second the -1 and the reference to Drew’s post, with the added comment
that the concern with extensions could be easily solved simply by giving
extensions access to private members of the extended type as long as those
extensions are in the same module/submodule (or file, if you prefer, but I
don’t). This would probably eliminate almost all of the use cases for
fileprivate, as well as freeing us from the sometimes clumsy situation
where we’re rather artificially forced to use files as a scope, instead
enabling us to organize code into files as is appropriate for the project.

Charles

_______________________________________________
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/20170321/6daff427/attachment-0001.html>


More information about the swift-evolution mailing list