[swift-evolution] access control proposal

Kevin Ballard kevin at sb.org
Sun Dec 6 01:23:02 CST 2015


On Sat, Dec 5, 2015, at 10:59 PM, David Owens II via swift-evolution wrote:
> I’d actually prefer the opposite extreme: I want everything public unless it’s prefixed with an _. To me, the _ prefix adds significantly more contextual awareness that I’m venturing into parts of the construct that are not intended for general use. It has the add benefit that it makes these types of uses grepable within the codebase so audits are quite trivial.

You can already use a _ prefix today to mark any function/property that
is not meant for general use, even within the confines of the file.
That's what I do; private methods/properties are fair game (if
accessible), but anything that's considered an implementation detail
gets a _ prefix. Applying your proposed rule would actually remove the
ability to use _ to distinguish things like this (and you'd start seeing
__ instead, which is even uglier).

-Kevin Ballard
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-evolution/attachments/20151205/a01a6420/attachment.html>


More information about the swift-evolution mailing list