Java, running with a byte code verifier and a strict security manager enabled 
does a reasonably through job of enforcing private methods at runtime. You can 
defeat it, but not typically with remotely loaded code such as applets. 

It's a continuum of design choices in languages. You're right that it has a lot 
to do with communicating intent to other programmers, but it can also be 
enforced. 



On Nov 7, 2011, at 8:33 PM, Graham Cox <[email protected]> wrote:

> 
> On 08/11/2011, at 12:16 PM, Don Quixote de la Mancha wrote:
> 
>> no method would be private.
> 
> 
> True, but Public/Private is really more of a way to organise your code for 
> its use by other humans. The compiler can enforce it to a degree, but the 
> real reason for having private methods is to hide them from users of your 
> code.
> 
> --Graham_______________________________________________
> 
> Cocoa-dev mailing list ([email protected])
> 
> Please do not post admin requests or moderator comments to the list.
> Contact the moderators at cocoa-dev-admins(at)lists.apple.com
> 
> Help/Unsubscribe/Update your Subscription:
> http://lists.apple.com/mailman/options/cocoa-dev/lordpixel%40mac.com
> 
> This email sent to [email protected]
_______________________________________________

Cocoa-dev mailing list ([email protected])

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [email protected]

Reply via email to