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

Chris Angelico rosuav at gmail.com
Fri Apr 19 09:33:01 EDT 2013


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. I've subclassed someone else's class using a
struct and just left everything public. In fact, I've gotten so used
to the Python way of doing things that now I'm quite happy to run
everything public anyway.

Is OOP truly about X if X is optional?

ChrisA



More information about the Python-list mailing list