Python was designed (was Re: Multi-threading in Python vs Java)

rusi rustompmody at gmail.com
Mon Oct 21 00:44:16 EDT 2013


On Monday, October 21, 2013 7:51:12 AM UTC+5:30, Roy Smith wrote:
> In article 
>  Steven D'Aprano  wrote:
> 
> > According to 
> > some, Java, which has many low-level machine primitive types, is an 
> > object-oriented language, while Python, which has no machine primitives 
> > and where every value is an object, is not. Explain that one, if you can.
>  
> That's easy to explain.  Python doesn't have private data, therefore it 
> isn't OO.  Well, according to the Java-esque gospel, at any rate.
>
> Whenever somebody tells you what OO means, ask him what part of the 
> elephant he's touching.

Nice one ! Complementarily one can ask what does a typical Picasso cubist painting eg http://www.artchive.com/artchive/p/picasso/cadaques.jpg
represent? The avant gardists will wax eloquent.
And some (of us philistines) will of course say: Nothing.
Just as there may an elephant which we are too blind to see, its good to keep in mind the possibility that there may be big words without anything actually there.

Colloquially known as the emperor's new clothes

On Monday, October 21, 2013 7:37:17 AM UTC+5:30, Steven D'Aprano wrote:
> > Unfortunately, even after 50 years of trying, semantics has been a
> > dismal failure in defining the what and where and whither of OOP. In a
> > sane world this would have signified that perhaps OOP as a concept(s)
> > needs to be questioned. Considering that the opposite has happened --
> > programming language semantics as an area has become distinctly
> > 'old-fashioned' and not-so-respectable-- I can only conclude that the
> > world is not sane.
>  
> All the words are in English, yet somehow I can't quite make sense of
> this paragraph. You seem to be using "semantics" in a way that doesn't
> quite make sense to me. To me, "programming language semantics" is the
> *meaning* of code: "var = func(arg)" is the syntax, "call func with arg
> and assign the result to var" is the semantics. What do you mean by it?

Yes its always good to be skeptical about the emperor's new clothes…

I thought I'd point to wikipedia http://en.wikipedia.org/wiki/Semantics_%28computer_science%29 but its doing a less than stellar job of it so heres my thoughts:


Programming language semantics categorises roughly into:
1. Operational
2. Denotational
3. Axiomatic
4. Algebraic

Some historical context:

1. proof theory vs model theory

In logic, the proof theorists want to study how to prove or reason about something
The model theorists, more platonically inclined, want to say what something is
Corresponds to the philosophical divide between epistemology and ontology/metaphysics.
The latter can be more 'grand' but is therefore subject to the most penetrating criticism.
Historically the big contributions of Aristotle and Plato were under the title of metaphysics and the big contributions of Kant and Hume were to show that for the most part metaphysics is bullshit.
In short these kinds of arguments are a bit older than you and me!!

In programming language research, the model-theorists end towards denotational semantics;
the proof theorists tend towards axiomatic and algebraic semantics;
The implementers come from the operational camp

2. programs ∈ languages

> To me, "programming language semantics" is the *meaning* of code.

Yes this is an eminently sensible pov (and has precedents like Hoare, Dijkstra, Floyd etc -- the 'axiomatic' guys). However you cannot really talk of the meaning of programs without talking of the meaning of programming languages. Clearly this -- the meaning of the language -- is a grander project and just as in philosophy, is as liable to called out as bullshit.  As an example the repeating argument about what IS a variable indicates the crying need to discuss this more metaphysically -- ie denotational semantically -- because if we dont, the result is just a mess

- in C a variable *means* this
- in python it means that
- in math it means something
- etc

> But then I can also criticise functional programming, declarative programming,
> imperative programming, logic programming, etc. There is no One True Programming 
> Paradigm suitable for every task, just as there is no One True Programming Language.

Analogy:

When we deal with an existing code-base, we often find flaws/issues/gaffes/whatever in the design or architecture.  On the other hand sometimes we find there is no design or architecture whatever
I believe there is a big difference between the two.  In PLs think php.

I think what Stepanov is saying (and most of the others at http://en.wikipedia.org/wiki/Object-oriented_programming#Criticism ) is this distinction.

My own view in summary: Between programming and mathematics, mathematics is the prior.  This is obviously true as history including the name 'computer' and all its modifications. To the extent that "ontogeny recapitulates phylogeny" this is true in fact as well.

The OOP aficionados are straining to break their umbilical cord with X. That X may -- depending on context/background -- be called math, logic, theory, philosophy, semantics, academics etc etc.
That name is less relevant than the lack of consideration: Where will our sustenance come from?

And I am reminded of Mark Twain:
------
When I was 13 years old I thought my father an utter fool. When I became 21 I was amazed at how much the old man had learnt in 8 years.
------

Do you want to make a date for opening this discussion again after 8 years <wink>??

Here's my side of the bet: OOP will be as respectable in 2021 as the goto is today?

Saying which reminds me of a personal memory. My teacher of programming once told me:
What the goto does to control structure, the assignment does to data structure.
Much of my trajectory as a programmer and teacher of programming is an elaboration of that statement.



More information about the Python-list mailing list