Re:Python Black Magic
by rryyan on Friday November 19, 2010 @12:21PM
(#1921967)
Access specifiers (like "private") are language features used to implement the OOP notion of encapsulation: http://en.wikipedia.org/wiki/Encapsulation_(object-oriented_.... Encapsulation is generally cited as one of the defining features of object oriented programming.
[ Parent
| on HN ]
Re:Python Black Magic
by silentbicycle on Friday November 19, 2010 @01:25PM
(#1922224)
Which is weird, because it's actually a defining feature of modular programming.
Public/private access are used to specify an interface to arbitrary functionality. Other modules can call a public interface, but all private internals can be removed / modified freely.
Re:Python Black Magic
by koenigdavidmj on Friday November 19, 2010 @03:26PM
(#1922668)
Yep, plenty of C modules do hacks to block access except through the defined API. Most are content simply to use void pointers in public header files, but some do nasty things like generating a random integer at library initialisation time and xor'ing all returned pointers by that number before returning it. (Eww.)