[swift-evolution] Make class and struct members private by default / Type-Based access

David Waite david at alkaline-solutions.com
Tue Apr 4 15:17:07 CDT 2017

> On Apr 4, 2017, at 7:07 AM, Ted F.A. van Gaalen via swift-evolution <swift-evolution at swift.org> wrote:
> Hi Xiaodi,
> that currently all members of a class or struct are exposed by default by having
> a default scope of  ‘internal’  and are therefore accessible in the entire module
> is imho very bad unstructured programming practice. 
> In no other OOP language it is implemented
> that way.. 

I think you may be forgetting Java (and Ruby, and Python, and Go, and Objective-C, and…)

In my experience , the hard-private-by-default comes from C++ and heavily influenced languages like C# and Rust.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-evolution/attachments/20170404/e452b203/attachment.html>

More information about the swift-evolution mailing list