[swift-evolution] final + lazy + fileprivate modifiers

Matt Whiteside mwhiteside.dev at gmail.com
Mon Feb 20 10:46:51 CST 2017


> On Feb 20, 2017, at 03:43, Ross O'Brien via swift-evolution <swift-evolution at swift.org> wrote:
> 
> Possibly the dependence on filesystem structure feels restrictive to some developers.

I agree with this.  For example in the Xcode 'symbol navigator’ view, where you can view all the classes/structs in your project hierarchically and alphabetically, you aren’t dealing with files at all, and from that point of view, fileprivate is just confusing.

> It seems to me that in this four-tier structure (public, internal, fileprivate, private) that a significant number of developers think that's one, maybe two tiers too many (the system should be simplified), and for others that's one, maybe two tiers too few (fileprivate is doing too much, and a submodule tier would relieve that pressure).

I think the four-tier structure is too many.  My understanding is that: public = everybody can get to it, internal = only those within the module can get to it, but beyond that, i.e., when and for what purpose one should use fileprivate vs private, it starts to get foggy to me.

-Matt



More information about the swift-evolution mailing list