[swift-evolution] [Pitch] Rename fileprivate to shared
James Froggatt
james.froggatt at me.com
Thu Apr 6 09:30:34 CDT 2017
As the title says, I think renaming `fileprivate` to `shared` is the simplest way to solve the issues we have with spelling.
My first line of reasoning is that it only affects one modifier, leaving private as it is. This minimises the amount of code affected, making it much more straightforward to migrate than the fileprivate-private-scoped switchup that has been suggested previously.
My justification for `shared` as the new spelling is that it expresses *why* the developer would use the access level - to share implementation details with something, be it an extension or another type. It sounds natural and first-class, and fits well within the hierarchy.
Private itself isn't too bad a default, and this change would leave it so, while making `shared` act as an informative identifier for where file-scope (or submodule-scope) sharing takes place. This would also hint at when the access level should be used from a design standpoint - more so than `fileprivate` or `file`.
More information about the swift-evolution
mailing list