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

Steven D'Aprano steve+comp.lang.python at pearwood.info
Fri Apr 19 08:00:14 EDT 2013


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.

OOP is a distinct paradigm from procedural programming, even though the 
distinctions are minor when compared to those between imperative and 
functional programming. Java's "everything in a class" style of 
programming is very distinct from Pascal's "functions and records" style 
of programming, even though both are examples of imperative programming. 
They lead to different styles of coding, they have different strengths 
and weaknesses, and even taking into account differences of syntax, they 
differ in what you can do simply and naturally without the language 
getting in the way.


> I agree fully.  This
> term is a holdover from the days when people spent time and space trying
> to build taxonomies based on ill-defined superficialities.  See Steve
> Gould's essay "What, If Anything, Is A Zebra?".  You'll enjoy learning
> that there is, in fact, no such thing as a zebra---there are, rather,
> three different striped horse-like mammals, two of which are genetically
> related, and one of which is not.

All life on earth is genetically related. Even if the so-called "tree of 
life" doesn't have a single common ancestor, it has a single set of 
common ancestors.

In the case of the three species of zebra, they are all members of the 
genus Equus, so they are actually *extremely* closely related. The 
argument that "zebra is not a genealogical group" (which is very 
different from the false statement that there is no such thing as a 
zebra!) is that one of the three species of zebra is in fact more closely 
related to non-zebras than the other two species of zebra.

Something like this tree:

Common ancestor of all Equus
|
+-- Common ancestor of Burchell's Zebras and Grevy's Zebras
|   +-- Burchell's Zebra
|   +-- Grevy's Zebra
|
+-- Common ancestor of horses and Mountain Zebras
    +-- Horse
    +-- Mountain Zebra

(I've left out asses and donkeys because I'm not sure where they fit in 
relation to the others.)

There's no natural genealogical group that includes all three species of 
zebra that doesn't also include horses. But that doesn't mean that 
there's no reasonable non-genealogical groups! For example, all three 
species of zebra have fewer than 50 chromosome pairs, while all other 
Equus species have more than 50 pairs. Based on physical characteristics 
rather than ancestry, zebras make up a perfectly good group, distinct 
from other members of Equus.

To put it another way, the three species of zebra may not make up a 
natural group when considered by lines of descent, but they do make up a 
natural group when considered by other factors.


> The propensity to be striped, like
> the propensity to have five things (fingers, segments, whatever) is a
> deeply embedded genetic artifact that expresses itself in various ways.

"Zebra" is not a classification of "thing that is striped", but a 
specific subset of such things, and stripes are only one of many 
distinguishing features. Cladistics is an important classification 
scheme, but it is not the only valid such scheme.


-- 
Steven



More information about the Python-list mailing list