[Review] SE-0159: Fix Private Access Levels

+1

-1: I have revised my opinion.

  • What is your evaluation of the proposal?

Makes the language easier to understand, lowers cognitive load during coding.
I also hope this will pave the way for a overhaul of the access level system including modularization.

I still hope that fileprivate will be dumped one day. Presumably when a better proposal is on the table.
However it is clear that for some people the disadvantage of dropping it now is bigger than the advantage to the proponents together.
Regardless of wether the need is only perceived or not.

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

yes.

yes, but not without an alternative solution in place at the time fileprivate is dropped.

Can you clarify what you mean here?

···

On Mar 23, 2017, at 11:35 AM, Rien via swift-evolution <swift-evolution@swift.org> wrote:

On 21 Mar 2017, at 08:05, Rien <rien@balancingrock.nl> wrote:

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

Yes

Yes

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

private vs fileprivate seems swift-only, as such I have no comparison.

Same

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

Followed and participated in the discussions.

Same.

Regards,
Rien

Site: http://balancingrock.nl
Blog: http://swiftrien.blogspot.com
Github: Balancingrock (Rien) · GitHub
Project: http://swiftfire.nl

On 21 Mar 2017, at 00:54, Douglas Gregor via swift-evolution <swift-evolution@swift.org> 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
Reviews are an important part of the Swift evolution process. All reviews should be sent to the swift-evolution mailing list at

https://lists.swift.org/mailman/listinfo/swift-evolution
or, if you would like to keep your feedback private, directly to the review manager. When replying, please try to keep the proposal link at the top of the message:

Proposal link:

https://github.com/apple/swift-evolution/blob/master/proposals/0159-fix-private-access-levels.md
Reply text
Other replies
What goes into a review?

The goal of the review process is to improve the proposal under review through constructive criticism and, eventually, determine the direction of Swift. When writing your review, here are some questions you might want to answer in your review:

  • What is your evaluation of the proposal?
  • Is the problem being addressed significant enough to warrant a change to Swift?
  • Does this proposal fit well with the feel and direction of Swift?
  • If you have used other languages or libraries with a similar feature, how do you feel that this proposal compares to those?
  • How much effort did you put into your review? A glance, a quick reading, or an in-depth study?
More information about the Swift evolution process is available at

https://github.com/apple/swift-evolution/blob/master/process.md
Thank you,

-Doug

Review Manager

_______________________________________________
swift-evolution mailing list
swift-evolution@swift.org
https://lists.swift.org/mailman/listinfo/swift-evolution

_______________________________________________
swift-evolution mailing list
swift-evolution@swift.org
https://lists.swift.org/mailman/listinfo/swift-evolution

I can't go into detail in public, but I can say that we did a postmortem on a large lost sale and the customer specifically cited the number of frameworks in our product as an integration barrier for them. Most iOS SDKs are distributed as a single framework and so with that backdrop the friction makes more sense.

As a result of that I have about 5 bugs open on how to reduce our framework footprint so our tools are easier for our users to integrate. There are a variety of solutions we use on that, what you see here is one of the saner ones, believe it or not.

Whether or not the technical requirement makes sense to you, the business case is very clear. So clear that if scoped were removed we would almost certainly keep the file and its potential threading bugs, over promoting a new framework. Sales >> code, unfortunately.

Oh, come on — that sounds like removing new private would threaten your existence… in this case, afaics a simple search & replace (private -> fileprivate) works just fine.
You may not like that solution, but others might not even notice the difference.
Imho the importance of SE-25 has been exaggerated tremendously before it was added, and the same seems to happen now, when its removal is discussed.

We shouldn't overdramatise this question, and don't invent arguments to support partialities:
Access control worked fine in Swift 2, and fileprivate didn't increase the complexity of the language in a way that makes it impossible to teach it.

There are arguments for both positions, and they are valid — but there is a huge variance in the perceived importance, and discussion has only very limited effect on this.

This fails to convince me.

I had similar thoughts.

I understand that, but not why.

I can't go into detail in public, but I can say that we did a postmortem on a large lost sale and the customer specifically cited the number of frameworks in our product as an integration barrier for them. Most iOS SDKs are distributed as a single framework and so with that backdrop the friction makes more sense.

I find this to be a somewhat convoluted motivation for the feature. This is a shortcoming of tooling/workflow that shows itself in the presence of large multi-framework Xcode projects. In other words, this use case seems fairly distant from what was intended for private vs fileprivate.

I also found the earlier example you gave, of using private vs fileprivate to create warnings on invalid access of thread state, to be stretching the access control beyond what was intended. This sounds like a job for compiler static analysis rather than access control.

-Matt

···

On Mar 23, 2017, at 00:10, Drew Crawford via swift-evolution <swift-evolution@swift.org> wrote:

+1

-1: I have revised my opinion.

  • What is your evaluation of the proposal?

Makes the language easier to understand, lowers cognitive load during coding.
I also hope this will pave the way for a overhaul of the access level system including modularization.

I still hope that fileprivate will be dumped one day. Presumably when a better proposal is on the table.
However it is clear that for some people the disadvantage of dropping it now is bigger than the advantage to the proponents together.
Regardless of wether the need is only perceived or not.

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

yes.

yes, but not without an alternative solution in place at the time fileprivate is dropped.

Can you clarify what you mean here?

Quite obviously the functionality of the current private feature is part of the workflow of a considerable number of people.
It does not really matter if this feature is necessary or not, they have it integrated in their thinking and workflow.
(Note: we don’t need "for element in collection" either, plain "1..N" for loops would suffice)
To me, that is enough reason to postpone this proposal until this functionality can be retained while at the same time reverting private back to its original meaning.

Rien.

···

On 23 Mar 2017, at 21:26, Jose Cheyo Jimenez <cheyo@masters3d.com> wrote:

On Mar 23, 2017, at 11:35 AM, Rien via swift-evolution <swift-evolution@swift.org> wrote:

On 21 Mar 2017, at 08:05, Rien <rien@balancingrock.nl> wrote:

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

Yes

Yes

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

private vs fileprivate seems swift-only, as such I have no comparison.

Same

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

Followed and participated in the discussions.

Same.

Regards,
Rien

Site: http://balancingrock.nl
Blog: http://swiftrien.blogspot.com
Github: Balancingrock (Rien) · GitHub
Project: http://swiftfire.nl

On 21 Mar 2017, at 00:54, Douglas Gregor via swift-evolution <swift-evolution@swift.org> 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
Reviews are an important part of the Swift evolution process. All reviews should be sent to the swift-evolution mailing list at

https://lists.swift.org/mailman/listinfo/swift-evolution
or, if you would like to keep your feedback private, directly to the review manager. When replying, please try to keep the proposal link at the top of the message:

Proposal link:

https://github.com/apple/swift-evolution/blob/master/proposals/0159-fix-private-access-levels.md
Reply text
Other replies
What goes into a review?

The goal of the review process is to improve the proposal under review through constructive criticism and, eventually, determine the direction of Swift. When writing your review, here are some questions you might want to answer in your review:

  • What is your evaluation of the proposal?
  • Is the problem being addressed significant enough to warrant a change to Swift?
  • Does this proposal fit well with the feel and direction of Swift?
  • If you have used other languages or libraries with a similar feature, how do you feel that this proposal compares to those?
  • How much effort did you put into your review? A glance, a quick reading, or an in-depth study?
More information about the Swift evolution process is available at

https://github.com/apple/swift-evolution/blob/master/process.md
Thank you,

-Doug

Review Manager

_______________________________________________
swift-evolution mailing list
swift-evolution@swift.org
https://lists.swift.org/mailman/listinfo/swift-evolution

_______________________________________________
swift-evolution mailing list
swift-evolution@swift.org
https://lists.swift.org/mailman/listinfo/swift-evolution

We kinda do, though, or did, in Objective-C (well, the “Objective” parts of it, anyway).

Charles

···

On Mar 24, 2017, at 11:41 AM, Drew Crawford via swift-evolution <swift-evolution@swift.org> wrote:

I would argue that supporting whatever the programmer's chosen mental model is actually Swift's greatest strength. We could have a language with only reference types for example, it would be far, far simpler and easier to teach. I am glad that we don't have that language.

There are a couple of problems with the design which are causing Cognitive Dissonance:

1) Private & fileprivate require very different mental models to operate them
2) They are named very similarly to each other
3) There is a third concept of “private to the type” which requires a third mental model, but is spelled the same way in other languages

How would you respond to the allegation that supporting different "redundant" semantic models is actually a *design goal* of Swift? For example:
Value semantics vs reference semantics
Pass-by-owned vs pass-by-shared vs pass-by-reference parameters
dynamic dispatch vs static dispatch
associatedtype vs generics
"complete" types (e.g. Array<Int>) vs "incomplete" types (Sequence) and which one is permitted after a colon
strong vs weak vs unowned

It isn’t the fact that there are multiple models, but they way those models interact with each other in the brain. You can actually have lots of different models without causing confusion, as long as the models fit well together. It also isn’t the number of access levels that is a problem. For example, you can have a ton of shirt sizes (XS, S, M, L, XL, XXL, 3XL) and it doesn’t cause more confusion as you add more sizes because they don’t conflict with one another.

A big part of the issue with our current access scheme is how similar the concepts are without being the same. That is then made worse by the fact that they have been given similar names.

Note also that your list above is a list of typical stumbling blocks for new programmers in most languages. Swift has actually done a remarkable job with most of these through careful design of the way that they are framed / exposed to the programmer. In general, these things are well separated from each other. For example, associatedtype and generics have completely different syntax. Still, each of the above features comes with a significant mental cost. We are willing to pay that cost because of how useful the distinction is.

Do you feel that allowing both scoped private & file-based private is actually important enough to warrant the significant design work it would take to bring it up to par with these other features? It is not impossible, but it really doesn’t feel worth the effort to me (say compared to using that time/energy/thought to check off features from the generics manifesto).

I would argue that supporting whatever the programmer's chosen mental model is actually Swift's greatest strength. We could have a language with only reference types for example, it would be far, far simpler and easier to teach. I am glad that we don't have that language. I don't use all of these in every program, but I use all of them eventually, and each one is right for some situation.

Many of us don't know half these models half as as well as we'd like. But we also like less than half of them half as well as they deserve. Visibility is in line with the trend here.

I disagree that supporting any mental model is a goal of Swift (or even something that it does). In general, Swift is an opinionated language, which means just the opposite.

Of the three, I am personally most supportive of file-based

My concern about dropping down to file-based is it doesn't allow any nesting, which isn't powerful enough for several examples posted in this discussion. Unless by "file-based" we mean "directory-based" which is another proposal that has seen strong opposition from the "it's too complicated" wing.

By file-based, I mean that visibility is thought of in units of file. That might be a single file or a collection of files, but it would never be part of a file.

You could potentially still have nesting with file-based access, if we feel that is a desirable trait when we design submodules. The boundaries would just still be in units of file. The main question there is whether the power is worth the added complexity.

…or we could unify under a scope or type based access system, which would have different strengths and weaknesses. But by trying to be all things to all people we are just ending up with a muddled mess.

Thanks,
Jon

···

On Mar 24, 2017, at 9:41 AM, Drew Crawford <drew@sealedabstract.com> wrote:

On March 24, 2017 at 5:00:33 AM, Jonathan Hull via swift-evolution (swift-evolution@swift.org <mailto:swift-evolution@swift.org>) wrote:

Several people have asked: What is the harm it causes?

I would like to provide a (hopefully) clear answer to that.

There are a couple of problems with the design which are causing Cognitive Dissonance:

1) Private & fileprivate require very different mental models to operate them
2) They are named very similarly to each other
3) There is a third concept of “private to the type” which requires a third mental model, but is spelled the same way in other languages

Any one of these would cause confusion. All of them together mean that even those of us who understand how they work are bothered by them on a subconscious level (similar to how misaligned graphics will give everyone a subconscious feeling that a graphic design is “off” even if they can’t discern why consciously). Even many of those who are arguing to keep private have argued to rename things or to make it work in a more type-based way by extending visibility to extensions. I don’t think anyone is denying there is a problem here with the status quo.

There is a general rule in design that things that look similar (or in this case are named similarly) need to behave similarly to avoid causing confusion (and conversely things that behave differently *need* to look different).

**This is not something that will go away simply by learning the behavior. It will continue to be a rough spot in the language that causes discomfort until the underlying design issue is fixed.**

The ideal solution here would be to choose a single model and make everything coherent under that. We choose either file-based, scope-based, or type-based access control and unify under that.

For file-based, that means that our sub-modules, when we add them, would need to be file-based as well.

If we choose Scope-based, then it really cries out for some sort of parameterized private. That is you only have private and public, but for private you would be able to name a scope to widen the visibility to the named scope. Submodules would then need to be scope based, and you would probably use the parameterized private with the submodule name to share data within it.

Type-based is very common in other languages, but I fear it would not play nicely with the way Swift has grown to work. The pros are that you could access private variables from extensions, but getting types to work together with the ease they do now would require a lot of design work (and may not even be quite possible). You also have additional complexities around subtypes, etc...

We really need to choose a single direction and not mix and match.

Of the three, I am personally most supportive of file-based because it is the closest to where we are now, and it seems to simplify many of the concerns about “friend” types by having visibility be dependent on proximity… which seems very intuitive to me.

As I said before, my preference would be to tentatively accept the change, but delay implementation until we design submodules for Swift 5. That way the design can be more cohesive as we can tackle it all at once. If submodules won’t be in scope until after Swift 5, then we should implement the change now.

I hope that explanation was at least a bit helpful…

Thanks,
Jon

Technical note: For the curious, basically we have made a design which is "locally consistent, but globally inconsistent". That is why the effect doesn’t go away after learning the concepts involved. Basically we have made the programming equivalent of the following image:
<F0F862F8-0489-49F0-A06A-BEB6B7AE5C92@hsd1.ca.comcast.net.>
https://upload.wikimedia.org/wikipedia/commons/7/7f/Impossible.png

_______________________________________________
swift-evolution mailing list
swift-evolution@swift.org <mailto:swift-evolution@swift.org>
https://lists.swift.org/mailman/listinfo/swift-evolution

Late to the party here

* What is your evaluation of the proposal?

I’m -1 on this. The proposal is not a difficult read, but may have been simply more simply named “Remove Scoped Access Level/Revert SE-0025” as that is what is being proposed. “Fix” seems to me to be a unfortunately worded judgmental proposal title.

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

No. I consider myself to be a fairly “new/n00b” Obj-C/Swift developer. Although SE-0025 was a change that required source changes when implemented, the reasoning was not difficult to understand and changes were simple to make once identified. Here they are from SE-0025

public: symbol visible outside the current module
internal: symbol visible within the current module
fileprivate: symbol visible within the current file
private: symbol visible within the current declaration

Moving forward these changes are not difficult to comprehend. I tend to make _everything_ “private” up front so I don’t have any API leakage. Then dial back to “fileprivate” as needed. It’s not difficult for me I guess. As such, I don’t believe that this change was “Actively Harmful”, especially for new developers who have a clean slate or simply are leaving everything unmarked (internal) anyhow until they move up to more advanced topics. Unraveling a generic or functional code someone else wrote uses way more cognitive power.

I’d like to address the suggestion that the migration for SE-0159 could “simply” be a search and replace without loss of functionality. This doesn’t make sense if you consider the entire code lifecycle. Sure the code gets migrated and compiles. This is fine if they code _never_ has to be read again. But as we know, code is written once and _read many times_ as it will need to be maintained. The distinction between private and fileprivate contains information, and although it may work correctly now, some information meant to help maintain that code has been lost if these keywords are merged and the functionality of scoped access is removed. So yes if you don’t maintain the code where this migration takes place, this would be ok. But Swift strives for readability. Moving classes to separate files to address these issues, creates a multitude of Bunny classes where again for readability some classes belong together in the same file for ease of comprehension (again, code is written once , read many times)

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

The spirit of the proposal to simplify access levels is well taken. This proposal however simplifies at the expense of lost functionality (Scoped Access levels) with no replacement. The threads talk a about submodules and other solutions that could fill this gap that are not on the roadmap, planned or possible which makes them non-admissible in considering this proposal.

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

I am more familiar with scoped access so perhaps that feels more natural to me. But with the current implementation Swift users can choose whether they use File Based or Scope Based tools, so although not ideal to either side, acceptable until a suitable replacement could be forged.

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

Re-read SE-0025/proposal/most of this very long thread

···

From: <swift-evolution-bounces@swift.org> on behalf of Tino Heth via swift-evolution <swift-evolution@swift.org>
Reply-To: Tino Heth <2th@gmx.de>
Date: Monday, March 27, 2017 at 6:48 AM
To: Zach Waldowski <zach@waldowski.me>
Cc: <swift-evolution@swift.org>
Subject: Re: [swift-evolution] [Review] SE-0159: Fix Private Access Levels

I am now absolutely thrilled to create a filter to Mark As Read anything else arising from this thread. Good luck.

That might be a good idea — after more than 200 messages, and a quite circular discussion with an unhealthy amount of ignorance for the opposing side ;-).

To fight the latter, I just tried to take the position that "new private" is really important, and this imho leads to interesting consequences...

This access modifier really doesn't solve a problem, like "let" does (unless the problem you want to solve is having a language with private access).

Have a look at this:

public struct SeperateConcerns {

   private var foo: Int = 0

   public mutating func updateFoo\(\_ value: Int\) \{

          print\(&quot;The only allowed way to change foo was invoked&quot;\)

          foo = value

   \}

   private var bar: Int = 0

   public mutating func updateBar\(\_ value: Int\) \{

          print\(&quot;The only allowed way to change bar was invoked&quot;\)

          bar = value

   \}

   private var foobar: Int = 0

   public mutating func updateFoobar\(\_ value: Int\) \{

          print\(&quot;The only allowed way to change foobar was invoked&quot;\)

          foobar = value

   \}

}

You can protect foo from being changed by code in other files, and from extensions in the same file — and if the latter is a concern, there should also be a way to limit access to foo to specific function in scope.

Afaik, somebody proposed "partial" type declarations, but without them, the meaning of private is rather arbitrary, and the feature is only useful for a tiny special case.

If we had partial types, the situation would be different, and if would be possible to declare extensions inside a partial declaration of another type, we could even remove fileprivate without an replacement (I guess I should write a separate mail for this thought…)

_______________________________________________ swift-evolution mailing list swift-evolution@swift.org https://lists.swift.org/mailman/listinfo/swift-evolution

Late to the party here

* What is your evaluation of the proposal?
I’m -1 on this. The proposal is not a difficult read, but may have been simply more simply named “Remove Scoped Access Level/Revert SE-0025” as that is what is being proposed. “Fix” seems to me to be a unfortunately worded judgmental proposal title.

* Is the problem being addressed significant enough to warrant a change?
No. I consider myself to be a fairly “new/n00b” Obj-C/Swift developer. Although SE-0025 was a change that required source changes when implemented, the reasoning was not difficult to understand and changes were simple to make once identified. Here they are from SE-0025

  • public: symbol visible outside the current module
  • internal: symbol visible within the current module
  • fileprivate: symbol visible within the current file
  • private: symbol visible within the current declaration

Moving forward these changes are not difficult to comprehend. I tend to make _everything_ “private” up front so I don’t have any API leakage. Then dial back to “fileprivate” as needed. It’s not difficult for me I guess.

Right. I do that myself more than I would like to admit.
But when we only loosen up/tighten down during coding then access levels are almost useless.
The point of access level control is in the design, not in the coding.
If we made a design (including access levels) and then have to dial back, that should be a warning that something is wrong.
To me, this is an argument in favour of the proposal.

Rien.

···

On 27 Mar 2017, at 16:46, Steven Knodl via swift-evolution <swift-evolution@swift.org> wrote:

  As such, I don’t believe that this change was “Actively Harmful”, especially for new developers who have a clean slate or simply are leaving everything unmarked (internal) anyhow until they move up to more advanced topics. Unraveling a generic or functional code someone else wrote uses way more cognitive power.

I’d like to address the suggestion that the migration for SE-0159 could “simply” be a search and replace without loss of functionality. This doesn’t make sense if you consider the entire code lifecycle. Sure the code gets migrated and compiles. This is fine if they code _never_ has to be read again. But as we know, code is written once and _read many times_ as it will need to be maintained. The distinction between private and fileprivate contains information, and although it may work correctly now, some information meant to help maintain that code has been lost if these keywords are merged and the functionality of scoped access is removed. So yes if you don’t maintain the code where this migration takes place, this would be ok. But Swift strives for readability. Moving classes to separate files to address these issues, creates a multitude of Bunny classes where again for readability some classes belong together in the same file for ease of comprehension (again, code is written once , read many times)

* Does this proposal fit well with the feel and direction of Swift?
The spirit of the proposal to simplify access levels is well taken. This proposal however simplifies at the expense of lost functionality (Scoped Access levels) with no replacement. The threads talk a about submodules and other solutions that could fill this gap that are not on the roadmap, planned or possible which makes them non-admissible in considering this proposal.

* If you have used other languages, libraries, or package managers with a similar feature, how do you feel that this proposal compares to those?
I am more familiar with scoped access so perhaps that feels more natural to me. But with the current implementation Swift users can choose whether they use File Based or Scope Based tools, so although not ideal to either side, acceptable until a suitable replacement could be forged.

* How much effort did you put into your review? A glance, a quick reading, or an in-depth study?
Re-read SE-0025/proposal/most of this very long thread

From: <swift-evolution-bounces@swift.org> on behalf of Tino Heth via swift-evolution <swift-evolution@swift.org>
Reply-To: Tino Heth <2th@gmx.de>
Date: Monday, March 27, 2017 at 6:48 AM
To: Zach Waldowski <zach@waldowski.me>
Cc: <swift-evolution@swift.org>
Subject: Re: [swift-evolution] [Review] SE-0159: Fix Private Access Levels

I am now absolutely thrilled to create a filter to Mark As Read anything else arising from this thread. Good luck.

That might be a good idea — after more than 200 messages, and a quite circular discussion with an unhealthy amount of ignorance for the opposing side ;-).

To fight the latter, I just tried to take the position that "new private" is really important, and this imho leads to interesting consequences...
This access modifier really doesn't solve a problem, like "let" does (unless the problem you want to solve is having a language with private access).
Have a look at this:

public struct SeperateConcerns {
       private var foo: Int = 0
       public mutating func updateFoo(_ value: Int) {
              print("The only allowed way to change foo was invoked")
              foo = value
       }

       private var bar: Int = 0
       public mutating func updateBar(_ value: Int) {
              print("The only allowed way to change bar was invoked")
              bar = value
       }

       private var foobar: Int = 0
       public mutating func updateFoobar(_ value: Int) {
              print("The only allowed way to change foobar was invoked")
              foobar = value
       }
}

You can protect foo from being changed by code in other files, and from extensions in the same file — and if the latter is a concern, there should also be a way to limit access to foo to specific function in scope.
Afaik, somebody proposed "partial" type declarations, but without them, the meaning of private is rather arbitrary, and the feature is only useful for a tiny special case.
If we had partial types, the situation would be different, and if would be possible to declare extensions inside a partial declaration of another type, we could even remove fileprivate without an replacement (I guess I should write a separate mail for this thought…)
_______________________________________________ swift-evolution mailing list swift-evolution@swift.org https://lists.swift.org/mailman/listinfo/swift-evolution
_______________________________________________
swift-evolution mailing list
swift-evolution@swift.org
https://lists.swift.org/mailman/listinfo/swift-evolution

I don’t see making things invisible to extensions to be the benefit of ‘private’ at all—it’s for maintaining encapsulation with embedded types. i.e. things like this:

class Foo {
  class Bar {
    private var baz: String // <— ‘Foo’ doesn’t need to access this
  }
}

This just enforces good programming style. On the other hand, the problem with extensions that people are talking about comes from using extensions to separate sections of a type’s built-in code, mainly around protocol conformances:

class Foo {
  private var bar: String
}

extension Foo: Baz {
  func requiredByBaz() {
    doSomething(with: self.bar) // <— ruh roh
  }
}

The way I look at it, the extension feature was created with the idea of extending someone else’s type in mind, but the community latched onto it as a way to organize the parts of your own type, and Swift 3’s ‘private’ is getting in the way of that. Broadening ‘private’ to reach in-module extensions would solve this issue, and would *also* allow flexibility to, when the code for an extension gets significantly large relative to the rest of the type's code, split that part off into a different file without needing to make your internal state visible to the entire module. Kill two birds with one stone, so to speak.

Charles

···

On Mar 21, 2017, at 12:11 AM, Xiaodi Wu via swift-evolution <swift-evolution@swift.org> wrote:

Charles Srstka's added comment, while intriguing, poses a problem in argumentation. One of the points being made above about the major advantage of new `private` over `fileprivate` is precisely that new `private` is invisible to extensions. If one "solves" the problem of having to use `fileprivate` by making `private` visible to extensions, it may well be the case that `fileprivate` is no longer commonly necessary--but one has also reverted one of the major arguments in favor of new `private` in the first place.

-1 on this as well for similar reasons. Places where I use fileprivate (aside from what was automatically migrated by Xcode) can be counted on fingers of one or two hands.

I feel that this proposal is reverting something without offering an alternative solution.

In what situations do you use Swift 3 private where fileprivate is not an acceptable replacement?

In my usage, I very rarely use fileprivate. To back this with numbers, a recent project I developed (i.e. without Xcode's automatic migration of private -> fileprivate; about 6KLOC) has 2 uses of "fileprivate" and 160 uses of "private”.

Do you have a way to tell how much of the private is effectible fileprivate? (top level private usage)

···

On Mar 21, 2017, at 1:10 AM, Charlie Monroe via swift-evolution <swift-evolution@swift.org> wrote:

On Mar 21, 2017, at 8:26 AM, Slava Pestov <spestov@apple.com <mailto:spestov@apple.com>> wrote:

On Mar 20, 2017, at 11:07 PM, Charlie Monroe via swift-evolution <swift-evolution@swift.org <mailto:swift-evolution@swift.org>> wrote:

This is definitely a personal opinion, but I tend to limit access to members as much as possible to discourage/prevent their usage out of the scope they are intended for and to better design API that should be used out of the scope (public/internal). I feel this is a good thing for newcomers to a codebase (and myself coming back to a codebase after a year or two) as Xcode's autocompletion won't offer members that are not supposed to be called out of the scope (scope-private).

As I've mentioned this during the discussion, I feel that current state of things encourages huge files (1000+ lines of code) as you can't define "protected" level access and migrate some of the code that implements e.g. accessibility to a different file without potentially exposing internal details to the rest of the module (if the extension in the other file needs access to private details, which is often the case).

I feel that if there should be a change to the access levels, it should address this as well. The current solution based on reverting the original proposal only unnecessarily exposes implementational details to the rest of the file - at least in my codebase.

Slava

On Mar 21, 2017, at 3:33 AM, Greg Parker via swift-evolution <swift-evolution@swift.org <mailto:swift-evolution@swift.org>> wrote:

On Mar 20, 2017, at 4:54 PM, Douglas Gregor <dgregor@apple.com <mailto:dgregor@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.

--
Greg Parker gparker@apple.com <mailto:gparker@apple.com> Runtime Wrangler

_______________________________________________
swift-evolution mailing list
swift-evolution@swift.org <mailto:swift-evolution@swift.org>
https://lists.swift.org/mailman/listinfo/swift-evolution

_______________________________________________
swift-evolution mailing list
swift-evolution@swift.org <mailto:swift-evolution@swift.org>
https://lists.swift.org/mailman/listinfo/swift-evolution

_______________________________________________
swift-evolution mailing list
swift-evolution@swift.org
https://lists.swift.org/mailman/listinfo/swift-evolution

> I’m not arguing that it is less or more than a majority. I’m just saying that we’ve seen a lot of talk against the original change.

This proposal asks us to balance the convenience of one group (extension-writers) against the existence of another (scoped-access users). To do that, we need a clear idea of the composition of both groups.

“A lot of talk” is not the evidentiary standard to remove a feature. It was not good enough when we introduced the feature, that required argument and clear use-cases.

> By default, I did not mean the syntactic default of the language but the access modifier users will use “by default” when trying to restrict visibility. In most languages, that keyword is “private” so its valid to say that newcomers to the language will “default” to using that one.

Apologies, but I do not understand the argument:

A user wants to restrict visibility (e.g. they are dissatisfied with “internal”)
The user *chooses* private because of familiarity from another language
The user is then surprised that their choice of private indeed restricted the visibility, thus achieving their goal?
What language does the user come from in which “private” is file-visible? It isn’t Java, C++, or PHP. C#’s “partial” is the closest I can think of, and it isn’t at all close.

A user who wants a middle-ground visibility would “default” to “protected”, “friend”, “partial”, or similar. After that does not compile, they will use google to find a middle-road visibility keyword, for which the only candidate is “fileprivate”. But they will not choose “private”, it’s just not a reasonable expectation of what the keyword means to a new Swift developer.

The popularity of private “as a default” is simply because many users prefer to hide their implementation details as a matter of routine code hygiene. Redefining private in order to thwart their code hygiene goal seems extreme.

I agree with several here (as I did in SE-0025) that our access modifiers are not well-named. However, that’s not the proposal in front of us.

> My own statistics in my projects show the contrary. At best, this shows how divisive this feature is.

This *may* show that, if contrary statistics were presented, but that hasn’t occurred.

In old code, statistics could be biased by the migrator having replaced all previous instances of private by fileprivate.

If the migrator migrated code to private, and it *worked* (e.g. did not introduce visibility errors) this is not bias, this is a correct use of the feature.

> I'm just arguing that the additional scope-based access modifier does not provide enough differentiation to be worth that complexity.

The only argument I have seen so far around “complexity” boils down to: “some people do not use it”. But some people *do* use it, and anyway if we are going to remove all the features “not enough people” use then we are in for a ride.

Swift 3 shipped, so what we are discussing now is yanking a keyword without replacement. There is code written that uses private to enforce its threading or security invariants. There is code written that uses private in order to shadow another declaration. There is code that will not compile after migration. We need more than a vague fear of complexity generally to throw a brick through all those windows. That brick will introduce quite a bit of complexity itself.

+1. On one side we have a vague notion of “complexity” which doesn’t appear to amount to much more than a statement of opinion that the granularity isn’t useful. On the other side we have people who find legitimate value in the feature for important and clearly articulated purposes. This seems to me to be a solid demonstration that the feature is useful.

Compiler verification of invariant-preserving encapsulation is important. It is not trivial. It is not something to be written off lightly because “you’re only protecting yourself from yourself”. People make very similar arguments against static typing outside of the Swift community but most of us here see value in static types. Frankly, I’m surprised that so many don’t see more value in compiler verified encapsulation. Is it as important as a robust static type system? No. But that doesn’t make it unimportant.

···

On Mar 21, 2017, at 10:57 AM, Drew Crawford via swift-evolution <swift-evolution@swift.org> wrote:

Concerning the one-class-per-file argument, I would suggest this counter-argument: when working in large projects, I believe it's a good thing if the language encourages (forces is too strong a word for my taste) a one class per file structure, it's good practice.

The form of the argument is invalid. Suppose I argued: "it’s a good thing for the language to encourage one definition per class (no extensions), it’s good practice. So we do not need fileprivate.” That would be very silly (although it has already been advanced as a straw-man position elsewhere in this thread). The argument that we do not need private because nobody should put multiple classes in a file is equally silly. There are reasons to do so, in fact one motivation was given in SE-0025:

> Putting related APIs and/or related implementations in the same file helps ensure consistency and reduces the time to find a particular API or implementation.

These concerns are not resolved by arguments of the form “just don’t do that”.

I empathize with the Swift2 programmer who got through two releases without a scoped access modifier and is annoyed by change. However, removing the feature now is more change, not less, so it makes their problem worse, not better.

On March 21, 2017 at 2:17:40 AM, David Hart (david@hartbit.com <mailto:david@hartbit.com>) wrote:

Perhaps it was a mistake, but I purposefully did not go into too much detail in the proposal because I think this debate is purely a question of philosophy on Swift and its language features. I did not want to add un-necessary bloat that would have added little rationalisation. Let me try to explain the holes in the proposal by answering your review:

On 21 Mar 2017, at 02:26, Drew Crawford via swift-evolution <swift-evolution@swift.org <mailto:swift-evolution@swift.org>> wrote:

I disagree quite strongly with the proposal.

First, the document draws conclusions without apparent supporting evidence, e.g.

> Since the release of Swift 3, the access level change of SE–0025 was met with dissatisfaction by a substantial proportion of the general Swift community. Those changes can be viewed as actively harmful, the new requirement for syntax/API changes.
What is “dissatisfaction by a substantial proportion of the general Swift community”? How was this measured/determined?

It’s not feasible to measure precisely the feeling of a whole community. But we get a feeling for it by following the mailing-list, by talking to colleagues, by reading twitter, etc… And it think we all agree that the debate is highly divisive and that a “substantial proportion” of the community was dissatisfied: I’m not arguing that it is less or more than a majority. I’m just saying that we’ve seen a lot of talk against the original change.

What was done to control for the population happy with SE-0025 who would e.g. not be likely to take up pitchforks?

That’s why its important we have this debate now.

Who argues these changes are “actively harmful” and where were they during SE-0025?

The proposal makes the argument that the changes are actively harmful. It’s now up to debate. By the way, even if several people (including me) were already against this proposal during the review, I don’t see why anybody would not have the right to change his mind, especially after several months of production usage and argue differently now.

> subtly encourages overuse of scoped access control and discourages the more reasonable default
Who claims that scoped access is “overused” and what is their argument for doing so?
Why is “fileprivate” the “more reasonable default”? In fact neither fileprivate *nor* private are default (reasonable or not!). Internal is the default. Nor does this proposal suggest we change that. So this seems a very strange statement.

By default, I did not mean the syntactic default of the language but the access modifier users will use “by default” when trying to restrict visibility. In most languages, that keyword is “private” so its valid to say that newcomers to the language will “default” to using that one. If the proposal is accepted, file-scoped private will regain that status.

> But is that distinction between private and fileprivate actively used by the larger community of Swift developers?
Yes. To cite some evidence, here are codebases I actively maintain:

> codebase | private # | fileprivate # | ratio |

>--------------------------------------------------------|-----------|---------------|-------|

> "M" (proprietary) | 486 | 249 | 2x |

> "N"(proprietary) | 179 | 59 | 3x |

> NaOH https://code.sealedabstract.com/drewcrawford/NaOH | 15 | 1 | 15x |

> atbuild GitHub - AnarchyTools/atbuild: The Anarchy Tools build tool | 54 | 5 | 11x |

So from my chair, not only is the distinction useful, but scoped access control (private) is overwhelmingly (2-15x) more useful than fileprivate.

My own statistics in my projects show the contrary. At best, this shows how divisive this feature is. During the discussion of this proposal, it was argued that making decisions based upon project statistics would be dangerous:

In old code, statistics could be biased by the migrator having replaced all previous instances of private by fileprivate.
In new code, satistics could be biased by people using private because of it being the “soft-default”, regardless of proper semantics.

> And if it were used pervasively, would it be worth the cognitive load and complexity of keeping two very similar access levels in the language? This proposal argues that answer to both questions is no

This proposal does not make any later argument about “cognitive load” or “complexity” I can identify. Did the proposal get truncated?

Sorry if I did not state it explicitly, but I see any feature/keyword added to the language as “additional complexity”. And that complexity is completely worth it when the feature adds significant expressivity. I'm just arguing that the additional scope-based access modifier does not provide enough differentiation to be worth that complexity.

What is stated (without evidence) is that "it is extremely common to use several extensions within a file” and that use of “private” is annoying in that case. I now extend the above table

> codebase | private # | fileprivate # | ratio | # of extensions (>=3 extensions in file) |

>--------------------------------------------------------|-----------|---------------|-------|------------------------------------------|

> "M" (proprietary) | 486 | 249 | 2x | 48 |

> "N"(proprietary) | 179 | 59 | 3x | 84 |

> NaOH https://code.sealedabstract.com/drewcrawford/NaOH | 15 | 1 | 15x | 3 |

> atbuild GitHub - AnarchyTools/atbuild: The Anarchy Tools build tool | 54 | 5 | 11x | 6 |

in order to demonstrate in my corner of Swift this is not “extremely common”, and is actually less popular than language features the proposal alleges aren’t used.

My point here is that **different people in different corners of the community program Swift differently and use different styles**. I can definitely empathize with folks like the author who use extensions to group functions and are annoyed that their favorite visibility modifier grew four extra characters. Perhaps we can come up with a keyword that is more succint.

I agree that different people in different corners use different styles. But you could use that argument to validate many features which would make a group of users happy; but all those feature together would just add bloat to the language. Swift has been known to be a very opinionated language, to keep the language simple yet expressive.

However, that is no reason to take away features from working codebases. A scoped access modifier is perhaps my favorite feature in Swift 3. Let’s not throw stuff away because it adds extra characters to one programming style.

Finally, SE-0025 establishes clear motivation for the scoped access modifier:

> Currently, the only reliable way to hide implementation details of a class is to put the code in a separate file and mark it as private. This is not ideal for the following reasons:

> It is not clear whether the implementation details are meant to be completely hidden or can be shared with some related code without the danger of misusing the APIs marked as private. If a file already has multiple classes, it is not clear if a particular API is meant to be hidden completely or can be shared with the other classes.

> It forces a one class per file structure, which is very limiting. Putting related APIs and/or related implementations in the same file helps ensure consistency and reduces the time to find a particular API or implementation. This does not mean that the classes in the same file need to share otherwise hidden APIs, but there is no way to express such sharability with the current access levels.

As far as I can see, the proposal does not actually address or acknowledge these problems at all, but cheerfully returns us to them. It would be a mistake to deprecate this feature without examining at all why we introduced it. And realistically we need new solutions to those problems before removing the existing one.

Drew

On March 20, 2017 at 6:54:55 PM, Douglas Gregor (dgregor@apple.com <mailto:dgregor@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 Reviews are an important part of the Swift evolution process. All reviews should be sent to the swift-evolution mailing list at

https://lists.swift.org/mailman/listinfo/swift-evolution or, if you would like to keep your feedback private, directly to the review manager. When replying, please try to keep the proposal link at the top of the message:

Proposal link:

https://github.com/apple/swift-evolution/blob/master/proposals/0159-fix-private-access-levels.md Reply text Other replies What goes into a review?

The goal of the review process is to improve the proposal under review through constructive criticism and, eventually, determine the direction of Swift. When writing your review, here are some questions you might want to answer in your review:

What is your evaluation of the proposal? Is the problem being addressed significant enough to warrant a change to Swift? Does this proposal fit well with the feel and direction of Swift? If you have used other languages or libraries with a similar feature, how do you feel that this proposal compares to those? How much effort did you put into your review? A glance, a quick reading, or an in-depth study? More information about the Swift evolution process is available at

https://github.com/apple/swift-evolution/blob/master/process.md Thank you,

-Doug

Review Manager

swift-evolution-announce mailing list swift-evolution-announce@swift.org <mailto:swift-evolution-announce@swift.org> https://lists.swift.org/mailman/listinfo/swift-evolution-announce_______________________________________________
swift-evolution mailing list
swift-evolution@swift.org <mailto:swift-evolution@swift.org>
https://lists.swift.org/mailman/listinfo/swift-evolution

_______________________________________________
swift-evolution mailing list
swift-evolution@swift.org <mailto:swift-evolution@swift.org>
https://lists.swift.org/mailman/listinfo/swift-evolution

True indeed… but can we agree that this is just an hypothetic example, and no issue that is likely to happen in productive code?
Or is this actually taken from one of the projects you measured?
Here is the expanded edition which is productive.

/**A dummy return value to indicate a method isn't threadsafe.
Because unused return values produce warnings in Swift, a caller who uses the method absentmindedly will have a warning in their code. This can be suppressed with `let _: NotThreadSafe` from the caller. */
struct NotThreadSafe { }

///There are many cache implementations with different performance characteristics.
///we model them with a protocol.
protocol CacheImplementation {
func prune() -> NotThreadSafe
}

///Many components share a single cache, so we expose it as a reference type
class Cache {

init\(\) \{ preconditionFailure\(&quot;Provide a constructor to satisfy the compiler&quot;\) \}
private var v: CacheImplementation
private let lock = DispatchQueue\(label: &quot;lock&quot;\)


private func prune\(\) \-&gt; NotThreadSafe \{
    v\.prune\(\)
    return NotThreadSafe\(\)
\}
///expose a threadsafe API to callers
internal func prune\(\) \{
    lock\.sync \{
        //supress the warning, since we have a lock\.
        let \_: NotThreadSafe = self\.prune\(\)
    \}
\}

}

extension Cache {
func pruneAgressively() {
for _ in 0..<5 {
self.prune()
}
}
}

Note that, in this example, the scoped access keyword actually makes extensions *easier*, not harder, to write, because the extension does not need to choose between a safe and unsafe version of the method.

I have a few cases like that in production code with an unthread safe
private function shadows a more public function that applies thread safety
for external callers, etc.

-Shawn

···

On Tue, Mar 21, 2017 at 9:37 AM Tino Heth via swift-evolution < swift-evolution@swift.org> wrote:

> Fact is, you can replace every occurrence of "private" with
"fileprivate", and your source would compile as before, whereas fileprivate
saves us from a "friend"-keyword.

This is certainly a source-breaking change. Consider:

struct Foo {

    fileprivate func foo()->String {return "foo" }

    private func foo()->Int {return 2}

}

print("\(Foo().foo())")

Replacing “private” with “fileprivate” here will introduce a compile error.

True indeed… but can we agree that this is just an hypothetic example, and
no issue that is likely to happen in productive code?
Or is this actually taken from one of the projects you measured?
_______________________________________________
swift-evolution mailing list
swift-evolution@swift.org
https://lists.swift.org/mailman/listinfo/swift-evolution

> I’m not arguing that it is less or more than a majority. I’m just saying that we’ve seen a lot of talk against the original change.

This proposal asks us to balance the convenience of one group (extension-writers) against the existence of another (scoped-access users). To do that, we need a clear idea of the composition of both groups.

“A lot of talk” is not the evidentiary standard to remove a feature. It was not good enough when we introduced the feature, that required argument and clear use-cases.

"A lot of talk" is not the evidence supporting the proposal: it's just a warning that something may be very controversial among the community. The arguments for the revert are in the proposal and in the discussions in this thread.

> By default, I did not mean the syntactic default of the language but the access modifier users will use “by default” when trying to restrict visibility. In most languages, that keyword is “private” so its valid to say that newcomers to the language will “default” to using that one.

Apologies, but I do not understand the argument:

A user wants to restrict visibility (e.g. they are dissatisfied with “internal”)
The user *chooses* private because of familiarity from another language
The user is then surprised that their choice of private indeed restricted the visibility, thus achieving their goal?
What language does the user come from in which “private” is file-visible? It isn’t Java, C++, or PHP. C#’s “partial” is the closest I can think of, and it isn’t at all close.

It has pointed quite a few times by core team members that comparison to languages is not a very strong arguments, especially when Swift does things differently for a good reason. I can't stop from quoting Xiaodi from a month back:

«The beauty of Swift 2's access modifiers was that they were based around files and modules, explicitly rejecting types and scopes as units for determining visibility.» -- Xiaodi

A user who wants a middle-ground visibility would “default” to “protected”, “friend”, “partial”, or similar. After that does not compile, they will use google to find a middle-road visibility keyword, for which the only candidate is “fileprivate”. But they will not choose “private”, it’s just not a reasonable expectation of what the keyword means to a new Swift developer.

The popularity of private “as a default” is simply because many users prefer to hide their implementation details as a matter of routine code hygiene. Redefining private in order to thwart their code hygiene goal seems extreme.

The point is that keeping both private and fileprivate feels like an un-necessary complication:

• either a programmer falls on your side of the fence and will use private as often as possible and relegate to fileprivate when the design leaves no other choice. At that point it feels like a language wart.
• or a programmer will fall on my side of the fence and use fileprivate all the time and the language feels like it has an unnecessary access modifier.

I'd argue that the cases when a programmer will use both meaningfully is very rare. As a consequence, we should try to only keep one. Removing fileprivate is a no-go with extensions so that leaves us with removing private.

I agree with several here (as I did in SE-0025) that our access modifiers are not well-named. However, that’s not the proposal in front of us.

> My own statistics in my projects show the contrary. At best, this shows how divisive this feature is.

This *may* show that, if contrary statistics were presented, but that hasn’t occurred.

I can generate statistics from my projects if you want. But it's unnecessary: I haven't used private once since it's introduction in Swift 3. I don't see the advantages it brings worth the trouble.

In old code, statistics could be biased by the migrator having replaced all previous instances of private by fileprivate.

If the migrator migrated code to private, and it *worked* (e.g. did not introduce visibility errors) this is not bias, this is a correct use of the feature.

The migrator migrated to fileprivate everywhere, not private, disagreeing with your use of fileprivate.

> I'm just arguing that the additional scope-based access modifier does not provide enough differentiation to be worth that complexity.

The only argument I have seen so far around “complexity” boils down to: “some people do not use it”. But some people *do* use it, and anyway if we are going to remove all the features “not enough people” use then we are in for a ride.

Some people used the for(;;) loop, the ++ operator, var parameters. Many other features were removed from Swift to simplify he language, make it more consistent. Those are worthwhile goals. Yes, we are past Swift 3 now, but that doesn't mean we shouldn't be able to propose a few rare breaking proposals. The implementation of access modifiers came so late in the Swift 3 timeframe that we had little time to play around with them before Swift 3 was released. Now that we have, we have a short window of time to fix mistakes that were made. I'm just arguing that the proposal was one of those mistakes. But you have a right to disagree.

···

Sent from my iPhone

On 21 Mar 2017, at 16:57, Drew Crawford <drew@sealedabstract.com> wrote:
Swift 3 shipped, so what we are discussing now is yanking a keyword without replacement. There is code written that uses private to enforce its threading or security invariants. There is code written that uses private in order to shadow another declaration. There is code that will not compile after migration. We need more than a vague fear of complexity generally to throw a brick through all those windows. That brick will introduce quite a bit of complexity itself.

Concerning the one-class-per-file argument, I would suggest this counter-argument: when working in large projects, I believe it's a good thing if the language encourages (forces is too strong a word for my taste) a one class per file structure, it's good practice.

The form of the argument is invalid. Suppose I argued: "it’s a good thing for the language to encourage one definition per class (no extensions), it’s good practice. So we do not need fileprivate.” That would be very silly (although it has already been advanced as a straw-man position elsewhere in this thread). The argument that we do not need private because nobody should put multiple classes in a file is equally silly. There are reasons to do so, in fact one motivation was given in SE-0025:

> Putting related APIs and/or related implementations in the same file helps ensure consistency and reduces the time to find a particular API or implementation.

These concerns are not resolved by arguments of the form “just don’t do that”.

I empathize with the Swift2 programmer who got through two releases without a scoped access modifier and is annoyed by change. However, removing the feature now is more change, not less, so it makes their problem worse, not better.

On March 21, 2017 at 2:17:40 AM, David Hart (david@hartbit.com) wrote:

Perhaps it was a mistake, but I purposefully did not go into too much detail in the proposal because I think this debate is purely a question of philosophy on Swift and its language features. I did not want to add un-necessary bloat that would have added little rationalisation. Let me try to explain the holes in the proposal by answering your review:

On 21 Mar 2017, at 02:26, Drew Crawford via swift-evolution <swift-evolution@swift.org> wrote:

I disagree quite strongly with the proposal.

First, the document draws conclusions without apparent supporting evidence, e.g.

> Since the release of Swift 3, the access level change of SE–0025 was met with dissatisfaction by a substantial proportion of the general Swift community. Those changes can be viewed as actively harmful, the new requirement for syntax/API changes.
What is “dissatisfaction by a substantial proportion of the general Swift community”? How was this measured/determined?

It’s not feasible to measure precisely the feeling of a whole community. But we get a feeling for it by following the mailing-list, by talking to colleagues, by reading twitter, etc… And it think we all agree that the debate is highly divisive and that a “substantial proportion” of the community was dissatisfied: I’m not arguing that it is less or more than a majority. I’m just saying that we’ve seen a lot of talk against the original change.

What was done to control for the population happy with SE-0025 who would e.g. not be likely to take up pitchforks?

That’s why its important we have this debate now.

Who argues these changes are “actively harmful” and where were they during SE-0025?

The proposal makes the argument that the changes are actively harmful. It’s now up to debate. By the way, even if several people (including me) were already against this proposal during the review, I don’t see why anybody would not have the right to change his mind, especially after several months of production usage and argue differently now.

> subtly encourages overuse of scoped access control and discourages the more reasonable default
Who claims that scoped access is “overused” and what is their argument for doing so?
Why is “fileprivate” the “more reasonable default”? In fact neither fileprivate *nor* private are default (reasonable or not!). Internal is the default. Nor does this proposal suggest we change that. So this seems a very strange statement.

By default, I did not mean the syntactic default of the language but the access modifier users will use “by default” when trying to restrict visibility. In most languages, that keyword is “private” so its valid to say that newcomers to the language will “default” to using that one. If the proposal is accepted, file-scoped private will regain that status.

> But is that distinction between private and fileprivate actively used by the larger community of Swift developers?
Yes. To cite some evidence, here are codebases I actively maintain:

> codebase | private # | fileprivate # | ratio |

>--------------------------------------------------------|-----------|---------------|-------|

> "M" (proprietary) | 486 | 249 | 2x |

> "N"(proprietary) | 179 | 59 | 3x |

> NaOH https://code.sealedabstract.com/drewcrawford/NaOH | 15 | 1 | 15x |

> atbuild GitHub - AnarchyTools/atbuild: The Anarchy Tools build tool | 54 | 5 | 11x |

So from my chair, not only is the distinction useful, but scoped access control (private) is overwhelmingly (2-15x) more useful than fileprivate.

My own statistics in my projects show the contrary. At best, this shows how divisive this feature is. During the discussion of this proposal, it was argued that making decisions based upon project statistics would be dangerous:

In old code, statistics could be biased by the migrator having replaced all previous instances of private by fileprivate.
In new code, satistics could be biased by people using private because of it being the “soft-default”, regardless of proper semantics.

> And if it were used pervasively, would it be worth the cognitive load and complexity of keeping two very similar access levels in the language? This proposal argues that answer to both questions is no

This proposal does not make any later argument about “cognitive load” or “complexity” I can identify. Did the proposal get truncated?

Sorry if I did not state it explicitly, but I see any feature/keyword added to the language as “additional complexity”. And that complexity is completely worth it when the feature adds significant expressivity. I'm just arguing that the additional scope-based access modifier does not provide enough differentiation to be worth that complexity.

What is stated (without evidence) is that "it is extremely common to use several extensions within a file” and that use of “private” is annoying in that case. I now extend the above table

> codebase | private # | fileprivate # | ratio | # of extensions (>=3 extensions in file) |

>--------------------------------------------------------|-----------|---------------|-------|------------------------------------------|

> "M" (proprietary) | 486 | 249 | 2x | 48 |

> "N"(proprietary) | 179 | 59 | 3x | 84 |

> NaOH https://code.sealedabstract.com/drewcrawford/NaOH | 15 | 1 | 15x | 3 |

> atbuild GitHub - AnarchyTools/atbuild: The Anarchy Tools build tool | 54 | 5 | 11x | 6 |

in order to demonstrate in my corner of Swift this is not “extremely common”, and is actually less popular than language features the proposal alleges aren’t used.

My point here is that **different people in different corners of the community program Swift differently and use different styles**. I can definitely empathize with folks like the author who use extensions to group functions and are annoyed that their favorite visibility modifier grew four extra characters. Perhaps we can come up with a keyword that is more succint.

I agree that different people in different corners use different styles. But you could use that argument to validate many features which would make a group of users happy; but all those feature together would just add bloat to the language. Swift has been known to be a very opinionated language, to keep the language simple yet expressive.

However, that is no reason to take away features from working codebases. A scoped access modifier is perhaps my favorite feature in Swift 3. Let’s not throw stuff away because it adds extra characters to one programming style.

Finally, SE-0025 establishes clear motivation for the scoped access modifier:

> Currently, the only reliable way to hide implementation details of a class is to put the code in a separate file and mark it as private. This is not ideal for the following reasons:

> It is not clear whether the implementation details are meant to be completely hidden or can be shared with some related code without the danger of misusing the APIs marked as private. If a file already has multiple classes, it is not clear if a particular API is meant to be hidden completely or can be shared with the other classes.

> It forces a one class per file structure, which is very limiting. Putting related APIs and/or related implementations in the same file helps ensure consistency and reduces the time to find a particular API or implementation. This does not mean that the classes in the same file need to share otherwise hidden APIs, but there is no way to express such sharability with the current access levels.

As far as I can see, the proposal does not actually address or acknowledge these problems at all, but cheerfully returns us to them. It would be a mistake to deprecate this feature without examining at all why we introduced it. And realistically we need new solutions to those problems before removing the existing one.

Drew

On March 20, 2017 at 6:54:55 PM, Douglas Gregor (dgregor@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 Reviews are an important part of the Swift evolution process. All reviews should be sent to the swift-evolution mailing list at

https://lists.swift.org/mailman/listinfo/swift-evolution or, if you would like to keep your feedback private, directly to the review manager. When replying, please try to keep the proposal link at the top of the message:

Proposal link:

https://github.com/apple/swift-evolution/blob/master/proposals/0159-fix-private-access-levels.md Reply text Other replies What goes into a review?

The goal of the review process is to improve the proposal under review through constructive criticism and, eventually, determine the direction of Swift. When writing your review, here are some questions you might want to answer in your review:

What is your evaluation of the proposal? Is the problem being addressed significant enough to warrant a change to Swift? Does this proposal fit well with the feel and direction of Swift? If you have used other languages or libraries with a similar feature, how do you feel that this proposal compares to those? How much effort did you put into your review? A glance, a quick reading, or an in-depth study? More information about the Swift evolution process is available at

https://github.com/apple/swift-evolution/blob/master/process.md Thank you,

-Doug

Review Manager

swift-evolution-announce mailing list swift-evolution-announce@swift.org https://lists.swift.org/mailman/listinfo/swift-evolution-announce

_______________________________________________
swift-evolution mailing list
swift-evolution@swift.org
https://lists.swift.org/mailman/listinfo/swift-evolution

> I’m not arguing that it is less or more than a majority. I’m just saying that we’ve seen a lot of talk against the original change.

This proposal asks us to balance the convenience of one group (extension-writers) against the existence of another (scoped-access users). To do that, we need a clear idea of the composition of both groups.

“A lot of talk” is not the evidentiary standard to remove a feature. It was not good enough when we introduced the feature, that required argument and clear use-cases.

> By default, I did not mean the syntactic default of the language but the access modifier users will use “by default” when trying to restrict visibility. In most languages, that keyword is “private” so its valid to say that newcomers to the language will “default” to using that one.

Apologies, but I do not understand the argument:

A user wants to restrict visibility (e.g. they are dissatisfied with “internal”)
The user *chooses* private because of familiarity from another language
The user is then surprised that their choice of private indeed restricted the visibility, thus achieving their goal?
What language does the user come from in which “private” is file-visible? It isn’t Java, C++, or PHP. C#’s “partial” is the closest I can think of, and it isn’t at all close.

I agree, the old change gave private a much more commonly understood and IMHO more understandable meaning (changing do while into repeat while is the kind of change I would not like to see again unless well justified :)).

···

Sent from my iPhone

On 21 Mar 2017, at 15:57, Drew Crawford via swift-evolution <swift-evolution@swift.org> wrote:

A user who wants a middle-ground visibility would “default” to “protected”, “friend”, “partial”, or similar. After that does not compile, they will use google to find a middle-road visibility keyword, for which the only candidate is “fileprivate”. But they will not choose “private”, it’s just not a reasonable expectation of what the keyword means to a new Swift developer.

The popularity of private “as a default” is simply because many users prefer to hide their implementation details as a matter of routine code hygiene. Redefining private in order to thwart their code hygiene goal seems extreme.

I agree with several here (as I did in SE-0025) that our access modifiers are not well-named. However, that’s not the proposal in front of us.

> My own statistics in my projects show the contrary. At best, this shows how divisive this feature is.

This *may* show that, if contrary statistics were presented, but that hasn’t occurred.

In old code, statistics could be biased by the migrator having replaced all previous instances of private by fileprivate.

If the migrator migrated code to private, and it *worked* (e.g. did not introduce visibility errors) this is not bias, this is a correct use of the feature.

> I'm just arguing that the additional scope-based access modifier does not provide enough differentiation to be worth that complexity.

The only argument I have seen so far around “complexity” boils down to: “some people do not use it”. But some people *do* use it, and anyway if we are going to remove all the features “not enough people” use then we are in for a ride.

Swift 3 shipped, so what we are discussing now is yanking a keyword without replacement. There is code written that uses private to enforce its threading or security invariants. There is code written that uses private in order to shadow another declaration. There is code that will not compile after migration. We need more than a vague fear of complexity generally to throw a brick through all those windows. That brick will introduce quite a bit of complexity itself.

Concerning the one-class-per-file argument, I would suggest this counter-argument: when working in large projects, I believe it's a good thing if the language encourages (forces is too strong a word for my taste) a one class per file structure, it's good practice.

The form of the argument is invalid. Suppose I argued: "it’s a good thing for the language to encourage one definition per class (no extensions), it’s good practice. So we do not need fileprivate.” That would be very silly (although it has already been advanced as a straw-man position elsewhere in this thread). The argument that we do not need private because nobody should put multiple classes in a file is equally silly. There are reasons to do so, in fact one motivation was given in SE-0025:

> Putting related APIs and/or related implementations in the same file helps ensure consistency and reduces the time to find a particular API or implementation.

These concerns are not resolved by arguments of the form “just don’t do that”.

I empathize with the Swift2 programmer who got through two releases without a scoped access modifier and is annoyed by change. However, removing the feature now is more change, not less, so it makes their problem worse, not better.

On March 21, 2017 at 2:17:40 AM, David Hart (david@hartbit.com) wrote:

Perhaps it was a mistake, but I purposefully did not go into too much detail in the proposal because I think this debate is purely a question of philosophy on Swift and its language features. I did not want to add un-necessary bloat that would have added little rationalisation. Let me try to explain the holes in the proposal by answering your review:

On 21 Mar 2017, at 02:26, Drew Crawford via swift-evolution <swift-evolution@swift.org> wrote:

I disagree quite strongly with the proposal.

First, the document draws conclusions without apparent supporting evidence, e.g.

> Since the release of Swift 3, the access level change of SE–0025 was met with dissatisfaction by a substantial proportion of the general Swift community. Those changes can be viewed as actively harmful, the new requirement for syntax/API changes.
What is “dissatisfaction by a substantial proportion of the general Swift community”? How was this measured/determined?

It’s not feasible to measure precisely the feeling of a whole community. But we get a feeling for it by following the mailing-list, by talking to colleagues, by reading twitter, etc… And it think we all agree that the debate is highly divisive and that a “substantial proportion” of the community was dissatisfied: I’m not arguing that it is less or more than a majority. I’m just saying that we’ve seen a lot of talk against the original change.

What was done to control for the population happy with SE-0025 who would e.g. not be likely to take up pitchforks?

That’s why its important we have this debate now.

Who argues these changes are “actively harmful” and where were they during SE-0025?

The proposal makes the argument that the changes are actively harmful. It’s now up to debate. By the way, even if several people (including me) were already against this proposal during the review, I don’t see why anybody would not have the right to change his mind, especially after several months of production usage and argue differently now.

> subtly encourages overuse of scoped access control and discourages the more reasonable default
Who claims that scoped access is “overused” and what is their argument for doing so?
Why is “fileprivate” the “more reasonable default”? In fact neither fileprivate *nor* private are default (reasonable or not!). Internal is the default. Nor does this proposal suggest we change that. So this seems a very strange statement.

By default, I did not mean the syntactic default of the language but the access modifier users will use “by default” when trying to restrict visibility. In most languages, that keyword is “private” so its valid to say that newcomers to the language will “default” to using that one. If the proposal is accepted, file-scoped private will regain that status.

> But is that distinction between private and fileprivate actively used by the larger community of Swift developers?
Yes. To cite some evidence, here are codebases I actively maintain:

> codebase | private # | fileprivate # | ratio |

>--------------------------------------------------------|-----------|---------------|-------|

> "M" (proprietary) | 486 | 249 | 2x |

> "N"(proprietary) | 179 | 59 | 3x |

> NaOH https://code.sealedabstract.com/drewcrawford/NaOH | 15 | 1 | 15x |

> atbuild GitHub - AnarchyTools/atbuild: The Anarchy Tools build tool | 54 | 5 | 11x |

So from my chair, not only is the distinction useful, but scoped access control (private) is overwhelmingly (2-15x) more useful than fileprivate.

My own statistics in my projects show the contrary. At best, this shows how divisive this feature is. During the discussion of this proposal, it was argued that making decisions based upon project statistics would be dangerous:

In old code, statistics could be biased by the migrator having replaced all previous instances of private by fileprivate.
In new code, satistics could be biased by people using private because of it being the “soft-default”, regardless of proper semantics.

> And if it were used pervasively, would it be worth the cognitive load and complexity of keeping two very similar access levels in the language? This proposal argues that answer to both questions is no

This proposal does not make any later argument about “cognitive load” or “complexity” I can identify. Did the proposal get truncated?

Sorry if I did not state it explicitly, but I see any feature/keyword added to the language as “additional complexity”. And that complexity is completely worth it when the feature adds significant expressivity. I'm just arguing that the additional scope-based access modifier does not provide enough differentiation to be worth that complexity.

What is stated (without evidence) is that "it is extremely common to use several extensions within a file” and that use of “private” is annoying in that case. I now extend the above table

> codebase | private # | fileprivate # | ratio | # of extensions (>=3 extensions in file) |

>--------------------------------------------------------|-----------|---------------|-------|------------------------------------------|

> "M" (proprietary) | 486 | 249 | 2x | 48 |

> "N"(proprietary) | 179 | 59 | 3x | 84 |

> NaOH https://code.sealedabstract.com/drewcrawford/NaOH | 15 | 1 | 15x | 3 |

> atbuild GitHub - AnarchyTools/atbuild: The Anarchy Tools build tool | 54 | 5 | 11x | 6 |

in order to demonstrate in my corner of Swift this is not “extremely common”, and is actually less popular than language features the proposal alleges aren’t used.

My point here is that **different people in different corners of the community program Swift differently and use different styles**. I can definitely empathize with folks like the author who use extensions to group functions and are annoyed that their favorite visibility modifier grew four extra characters. Perhaps we can come up with a keyword that is more succint.

I agree that different people in different corners use different styles. But you could use that argument to validate many features which would make a group of users happy; but all those feature together would just add bloat to the language. Swift has been known to be a very opinionated language, to keep the language simple yet expressive.

However, that is no reason to take away features from working codebases. A scoped access modifier is perhaps my favorite feature in Swift 3. Let’s not throw stuff away because it adds extra characters to one programming style.

Finally, SE-0025 establishes clear motivation for the scoped access modifier:

> Currently, the only reliable way to hide implementation details of a class is to put the code in a separate file and mark it as private. This is not ideal for the following reasons:

> It is not clear whether the implementation details are meant to be completely hidden or can be shared with some related code without the danger of misusing the APIs marked as private. If a file already has multiple classes, it is not clear if a particular API is meant to be hidden completely or can be shared with the other classes.

> It forces a one class per file structure, which is very limiting. Putting related APIs and/or related implementations in the same file helps ensure consistency and reduces the time to find a particular API or implementation. This does not mean that the classes in the same file need to share otherwise hidden APIs, but there is no way to express such sharability with the current access levels.

As far as I can see, the proposal does not actually address or acknowledge these problems at all, but cheerfully returns us to them. It would be a mistake to deprecate this feature without examining at all why we introduced it. And realistically we need new solutions to those problems before removing the existing one.

Drew

On March 20, 2017 at 6:54:55 PM, Douglas Gregor (dgregor@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 Reviews are an important part of the Swift evolution process. All reviews should be sent to the swift-evolution mailing list at

https://lists.swift.org/mailman/listinfo/swift-evolution or, if you would like to keep your feedback private, directly to the review manager. When replying, please try to keep the proposal link at the top of the message:

Proposal link:

https://github.com/apple/swift-evolution/blob/master/proposals/0159-fix-private-access-levels.md Reply text Other replies What goes into a review?

The goal of the review process is to improve the proposal under review through constructive criticism and, eventually, determine the direction of Swift. When writing your review, here are some questions you might want to answer in your review:

What is your evaluation of the proposal? Is the problem being addressed significant enough to warrant a change to Swift? Does this proposal fit well with the feel and direction of Swift? If you have used other languages or libraries with a similar feature, how do you feel that this proposal compares to those? How much effort did you put into your review? A glance, a quick reading, or an in-depth study? More information about the Swift evolution process is available at

https://github.com/apple/swift-evolution/blob/master/process.md Thank you,

-Doug

Review Manager

swift-evolution-announce mailing list swift-evolution-announce@swift.org https://lists.swift.org/mailman/listinfo/swift-evolution-announce

_______________________________________________
swift-evolution mailing list
swift-evolution@swift.org
https://lists.swift.org/mailman/listinfo/swift-evolution

_______________________________________________
swift-evolution mailing list
swift-evolution@swift.org
https://lists.swift.org/mailman/listinfo/swift-evolution

Sent from my iPhone

One point which was raised by a couple of different people on this thread (Brent Royal-Gordon, Jonathan Hull), which gave me some hesitation in voting in favor of this proposal, is that it might make more sense to leave things alone for the time being, with the understanding that scoped access will be solved in some more general way via submodules in the future.

For what it's worth, I don't really agree with Jonathan Hull on this. If we're going to remove the band-aid, we might as well rip it off now; there's no reason to wait for people to write more code for us to break.

Fair point, but I honestly do not see how the stated very strong burden of proof to revert previous proposals has been met. The new proposal does seem to do anything really to address the needs of those that have a legitimate use for scoped access and the current state of things does not make life impossible for people who want to use file based visibility only or mostly. I really want to avoid having another proposal like the one that removed argument labels from blocks (burying them from the type param) that is incomplete and supposed to get addressed, but still has not been almost a year later.

This proposal as it is does not feel complete and I do not think this helps it satisfy the burden of proof needed for this release.

Agreed with the general idea of incompleteness.

I am less sanguine about the burden of proof.

Imo there is no absolute and irrevocable proof needed to accept or reject a change proposal.

I was under the impression that Swift should be treated as a living and evolving language, fitting and moulding itself to the need, desires and wishes of its users.

Rejecting only on the basis of need would be too limiting imo.

And that can be a problem in cases like these: an unliked feature that some people feel a need for.

Rien.

···

On 22 Mar 2017, at 10:53, Goffredo Marocchi via swift-evolution <swift-evolution@swift.org> wrote:
On 22 Mar 2017, at 09:43, Brent Royal-Gordon via swift-evolution <swift-evolution@swift.org> wrote:

On Mar 21, 2017, at 11:29 PM, Matt Whiteside via swift-evolution <swift-evolution@swift.org> wrote:

My point was simply that the burden of proof is now on those proposing to revert SE-0025, and the core team shouldn't accept this proposal unless they are satisfied that the burden has clearly been met.

--
Brent Royal-Gordon
Architechies

_______________________________________________
swift-evolution mailing list
swift-evolution@swift.org
https://lists.swift.org/mailman/listinfo/swift-evolution

_______________________________________________
swift-evolution mailing list
swift-evolution@swift.org
https://lists.swift.org/mailman/listinfo/swift-evolution

To what extent could your need for safety be satisfied by (a) giving the property a long, unique name like `unsafeUnsynchronizedT`, and (b) writing a very small unit test/shell script/Perl script which makes sure references to that very unique name only appear between the two "MARK:" comments?

···

--
Brent Royal-Gordon
Sent from my iPhone

On Mar 23, 2017, at 10:11 AM, Tino Heth via swift-evolution <swift-evolution@swift.org> wrote:

I can't go into detail in public, but I can say that we did a postmortem on a large lost sale and the customer specifically cited the number of frameworks in our product as an integration barrier for them. Most iOS SDKs are distributed as a single framework and so with that backdrop the friction makes more sense.

As a result of that I have about 5 bugs open on how to reduce our framework footprint so our tools are easier for our users to integrate. There are a variety of solutions we use on that, what you see here is one of the saner ones, believe it or not.

Whether or not the technical requirement makes sense to you, the business case is very clear. So clear that if scoped were removed we would almost certainly keep the file and its potential threading bugs, over promoting a new framework. Sales >> code, unfortunately.

Oh, come on — that sounds like removing new private would threaten your existence… in this case, afaics a simple search & replace (private -> fileprivate) works just fine.
You may not like that solution, but others might not even notice the difference.
Imho the importance of SE-25 has been exaggerated tremendously before it was added, and the same seems to happen now, when its removal is discussed.

We shouldn't overdramatise this question, and don't invent arguments to support partialities:
Access control worked fine in Swift 2, and fileprivate didn't increase the complexity of the language in a way that makes it impossible to teach it.

There are arguments for both positions, and they are valid — but there is a huge variance in the perceived importance, and discussion has only very limited effect on this.
_______________________________________________
swift-evolution mailing list
swift-evolution@swift.org
https://lists.swift.org/mailman/listinfo/swift-evolution

We will get static linking at some point in the near future.

Static linking does not fix this issue. Just change "framework" to ".a".

If we wait until we get submodules, we won't be able to revisit. This is probably our last chance to "remove" a feature. Submodules can always add features down the way.

Maybe submodules will solve this issue, maybe not. But submodules are *much* more complex than scoped access:

* Performance. This is hot code we compile with WMO. Moving it into a submodule could reduce visibility for optimization in a way that causes a performance regression. In particular, we know that specialization of T is a performance requirement, it isn't clear whether that would be preserved. Does WMO provide the same visibility across submodules? Nobody knows.

* Namespacing. It's possible that one program may ship 3-4 versions of this code because each dependency has a slightly different version under our current samizdat process. It is not clear whether submodules would avoid the "duplicate symbols" issue from C/ObjC. Xiaodi seems quite concerned about a related "duplicate functions" problem involved with private today, doubling down on that is not a good idea.

* It is not clear whether submodules are from an objectcode point of view merged into the parent library or kept as individual libraries

* It is not clear from a .swiftmodule point of view whether submodules are merged into the parent module or distributed as .swiftmodules / .swiftdocs

* Not clear how much ABI impact there is from submodules at a time when we are supposed to be trying to stabilize it

I would love to believe that a proposal on submodules will come through having solutions to all these issues and many more, then we will implement it and all sing kumbayah. But we are a long distance from that, and it may never happen at all, certainly we cannot evaluate proposals that haven't been written. Meanwhile we have a solution in the hand.

···

On March 23, 2017 at 2:22:20 AM, David Hart (david@hartbit.com) wrote:

To what extent could your need for safety be satisfied by (a) giving the property a long, unique name like `unsafeUnsynchronizedT`, and (b) writing a very small unit test/shell script/Perl script which makes sure references to that very unique name only appear between the two "MARK:" comments?
A third-party linter to get a scoped feature is our current candidate for reimplementing this feature if it's dropped from Swift.

However, I think it's worth asking to what extent it makes sense to build a language that gets fixed with linters. For example Swift could have used a linter for typechecking (Python is doing this) but the benefits of compile-time typechecking affect a large number of programs and so we decided to ship with batteries included.

The scoped visibility is like the type system. It is a compile-time check that is used to catch threading, information disclosure, encapsulation violation, or similar bugs. These are problems that affect a large number of programs, we should ship with batteries included.

···

On March 23, 2017 at 12:32:38 PM, Brent Royal-Gordon (brent@architechies.com) wrote:

+1

-1: I have revised my opinion.

   • What is your evaluation of the proposal?

Makes the language easier to understand, lowers cognitive load during coding.
I also hope this will pave the way for a overhaul of the access level system including modularization.

I still hope that fileprivate will be dumped one day. Presumably when a better proposal is on the table.
However it is clear that for some people the disadvantage of dropping it now is bigger than the advantage to the proponents together.
Regardless of wether the need is only perceived or not.

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

yes.

yes, but not without an alternative solution in place at the time fileprivate is dropped.

Can you clarify what you mean here?

Quite obviously the functionality of the current private feature is part of the workflow of a considerable number of people.
It does not really matter if this feature is necessary or not, they have it integrated in their thinking and workflow.
(Note: we don’t need "for element in collection" either, plain "1..N" for loops would suffice)
To me, that is enough reason to postpone this proposal until this functionality can be retained while at the same time reverting private back to its original meaning.

That is alternative 3.

···

On Mar 24, 2017, at 12:32 AM, Rien <Rien@Balancingrock.nl> wrote:

On 23 Mar 2017, at 21:26, Jose Cheyo Jimenez <cheyo@masters3d.com> wrote:
On Mar 23, 2017, at 11:35 AM, Rien via swift-evolution <swift-evolution@swift.org> wrote:

On 21 Mar 2017, at 08:05, Rien <rien@balancingrock.nl> wrote:

Rien.

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

Yes

Yes

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

private vs fileprivate seems swift-only, as such I have no comparison.

Same

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

Followed and participated in the discussions.

Same.

Regards,
Rien

Site: http://balancingrock.nl
Blog: http://swiftrien.blogspot.com
Github: Balancingrock (Rien) · GitHub
Project: http://swiftfire.nl

On 21 Mar 2017, at 00:54, Douglas Gregor via swift-evolution <swift-evolution@swift.org> 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
Reviews are an important part of the Swift evolution process. All reviews should be sent to the swift-evolution mailing list at

https://lists.swift.org/mailman/listinfo/swift-evolution
or, if you would like to keep your feedback private, directly to the review manager. When replying, please try to keep the proposal link at the top of the message:

Proposal link:

https://github.com/apple/swift-evolution/blob/master/proposals/0159-fix-private-access-levels.md
Reply text
Other replies
What goes into a review?

The goal of the review process is to improve the proposal under review through constructive criticism and, eventually, determine the direction of Swift. When writing your review, here are some questions you might want to answer in your review:

   • What is your evaluation of the proposal?
   • Is the problem being addressed significant enough to warrant a change to Swift?
   • Does this proposal fit well with the feel and direction of Swift?
   • If you have used other languages or libraries with a similar feature, how do you feel that this proposal compares to those?
   • How much effort did you put into your review? A glance, a quick reading, or an in-depth study?
More information about the Swift evolution process is available at

https://github.com/apple/swift-evolution/blob/master/process.md
Thank you,

-Doug

Review Manager

_______________________________________________
swift-evolution mailing list
swift-evolution@swift.org
https://lists.swift.org/mailman/listinfo/swift-evolution

_______________________________________________
swift-evolution mailing list
swift-evolution@swift.org
https://lists.swift.org/mailman/listinfo/swift-evolution