[TYPES] The type/object distinction and possible synthesis of OOP and imperative programming languages

Roy Smith roy at panix.com
Fri Apr 19 11:31:48 EDT 2013


In article <mailman.821.1366378384.3114.python-list at python.org>,
 Chris Angelico <rosuav at gmail.com> wrote:

> On Fri, Apr 19, 2013 at 11:07 PM, Roy Smith <roy at panix.com> wrote:
> > I was indeed talking about the ways people think about programming.  For
> > example, OOP in C++ is very much about encapsulation.  People declare
> > all data private, and writing setter/getter functions which carefully
> > control what access outside entities have to your data.
> 
> The funny thing about that notion is that, even in C++, it's
> completely optional.

Well, yeah:

#define private public
#define protected public
#include <whatever.h>

Not to mention all sorts of horrible things you can do with pointers and 
const_cast, etc.  But that doesn't stop people from thinking that 
somehow they've built some uber-protected cocoon around their data, and 
that this is part and parcel of what OOPL is all about.



More information about the Python-list mailing list