Popular conceit about learning programming languages

Donn Cave donn at drizzle.com
Sun Nov 24 23:49:18 EST 2002


Quoth Pascal Costanza <costanza at web.de>:
| Donn Cave wrote:
|> Quoth Pascal Costanza <costanza at web.de>:
|> ...
|>| Just recently I have encountered some useful terminological distinctions 
|>| in c.l.l that made sense to me. There you have the imperative and 
|>| message-passing paradigms on the one hand, and the procedural and 
|>| object-oriented style on the other hand. The interesting bit is that 
|>| these things are independent. So procedural style is well-suited for the 
|>| imperative paradigm and object-oriented is well-suited for the 
|>| message-passing paradigm. However, you can also do message-passing in a 
|>| purely procedural languages as well as use the imperative style in most 
|>| object-oriented languages. I guess that you are thinking along these 
|>| lines as well.
|> 
|> Perhaps I could be, if message passing were clearer to me!
|
| Message passing means that there are several entities that communicate 
| by sending messages between them. The main points are that these 
| entities are autonomous and that there is no central "main" program that 
| controls the behavior of these entitities.

But that's somewhat circular.  Message passing means that there are
entities that pass messages, eh?  But what would a message be, precisely?
What are the semantics of passing, for the sender and the recipient?
How is it different from calling a subroutine?  Is multi-threaded
execution necessary for this model?  If there is no main program,
where does the program begin?  Can Python programs be written this
way, and if so how would you tell the difference?

|> It can be much harder to get something done in pure FP, at least
|> that's true for me.  Now, this is obviously because I ``think in
|> Python'', or rather I think in procedural terms, and someone who
|> ``thinks in Haskell'' will have less trouble.
|
| I have my doubts. When a Haskell program doesn't behave as expected you 
| have to know what goes on behind the scenes - you have to know which 
| expressions get evaluated at what stage, in which order statements are 
| executed, and so on, in order to understand the program's behavior. 
| However, languages like Haskell deliberately try to hide these things. 

Yes, that's an extra thing in Haskell - compared not only to Python,
but also to ML and other functional languages.  So we aren't really
talking about imperative vs. declarative here, though I admit it was
my idea to hold up Haskell as a particularly good example.

	Donn Cave, donn at drizzle.com



More information about the Python-list mailing list