You can say it's "in vogue" these days, but C had private, public, and internal visibility (private = declared in .c file, public = declared in public .h file, internal = declared in private .h file). It's not just that you can technically accomplish this in C, but people actually use this all the time. Look at almost any library and you'll find this. Other languages have had module and library scopes for accessibility for decades as well. It's really an aberration that some languages make it so that data structures are the scope for symbol accessibility. C++'s accessibility rules are just bizarre and awkward for polyglots.
I wrote about how it is like C [0] the other day. I should update the post with links to the Apple blog and some of things said on the forum. Maybe tonight.
Comments
You can say it's "in vogue" these days, but C had private, public, and internal visibility (private = declared in .c file, public = declared in public .h file, internal = declared in private .h file). It's not just that you can technically accomplish this in C, but people actually use this all the time. Look at almost any library and you'll find this. Other languages have had module and library scopes for accessibility for decades as well. It's really an aberration that some languages make it so that data structures are the scope for symbol accessibility. C++'s accessibility rules are just bizarre and awkward for polyglots.
I wrote about how it is like C [0] the other day. I should update the post with links to the Apple blog and some of things said on the forum. Maybe tonight.
[0] http://blog.human-friendly.com/swift-access-controls-are-lik...