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

Roy Smith roy at panix.com
Fri Apr 19 09:07:15 EDT 2013


In article <517131cd$0$29977$c3e8da3$5496439d at news.astraweb.com>,
 Steven D'Aprano <steve+comp.lang.python at pearwood.info> wrote:

> On Thu, 18 Apr 2013 17:14:13 -0400, Robert Harper wrote:
> 
> > In short, there is no such thing as a "paradigm".  
> 
> Of course there is. A paradigm is a distinct way of thinking, a 
> philosophy if you will. To say that there is no such thing as a paradigm 
> is to say that all ways of thinking about a topic are the same, and 
> that's clearly nonsense.

This thread has gone off in a strange direction.  When I said:

> One of the nice things about OOP is it means so many different things to 
> different people.  All of whom believe with religious fervor that they 
> know the true answer.

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.

Often, when you talk to C++ people, they will tell you that 
encapsulation is what OOP is all about.  What they are doing is saying, 
C++ isa OOPL, and C++ has encapsulation, therefore OOPL implies 
encapsulation.  When they look at something like Python, they say, 
"That's not object oriented because you don't have private data".

I suppose people who grew up learning Python as their first language 
look at something like C++ and say, "That's not OOP because classes 
aren't objects", or something equally silly.



More information about the Python-list mailing list