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

Vladimir.S svabox at gmail.com
Tue Mar 21 12:24:20 CDT 2017


> 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

>   * What is your evaluation of the proposal?

-1. As was mentioned in replies, many developers find current 'private' 
very useful and use it not because of its *name*, but because of its *value*.

I can support if we rename 'fileprivate' to 'private' back(and rename 
current 'private' to something like 'scoped','local' etc; plus probably 
disallow its usage at file level i.e. we should not have 'scoped class C{}' 
at top level, we'll have to change to 'private class C{}' to reduce 
confusions), but not removing of scoped access modifier.

IMO we should keep status quo and defer access modifier changes to the 
moment, when we'll have submodules and decision on what access modifiers we 
need exactly.

>   * Is the problem being addressed significant enough to warrant a change
>     to Swift?

I don't feel so. Proposal suggests to remove valuable feature(ability to 
isolate some code without moving it to separate file, model strict 
compiler-checked access control to some critical code) that is used by many 
developers, without IMO any significant improvements in it.

>   * Does this proposal fit well with the feel and direction of Swift?

Don't think so. We need complete proposal which covers submodules and total 
improvements/re-think for access modifiers.

>   * If you have used other languages or libraries with a similar feature,
>     how do you feel that this proposal compares to those?

C#, Delphi. Both have 'private'-like access modifier to isolate/protect 
code. Moreover, Delphi has 'private' and 'strict private' - first is 
accessible from inside the same file and second is not.


>   * How much effort did you put into your review? A glance, a quick
>     reading, or an in-depth study?

Reading proposal and discussion in mailing list.


More information about the swift-evolution mailing list