[Python-ideas] Message passing syntax for objects

Mark Janssen dreamingforward at gmail.com
Mon Mar 18 18:18:53 CET 2013


> Ian Cordasco wrote:
>>
>> On Sun, Mar 17, 2013 at 11:53 PM, Mark Janssen
>> <dreamingforward at gmail.com> wrote:
>>
>>> Hello,
>>>
>>> I just posted an answers on quora.com about OOP (http://qr.ae/TM1Vb)
>>> and wanted to engage the python community on the subject.
>
>
> My answer to that question would be that it *did*
> catch on, it's just that we changed the terminology.
> Instead of message passing, we talk about calling
> methods.

Yes, but this is where it breaks the OOP abstraction by 90 degrees.
By using function calls, you're telling the machine to do something.
But when you want to pass something to an object there should be a
natural way to do this for every object.  By using methods you pollute
the concept space with all sorts of semi-random (i.e. personal) names,
like append, add, enqueue, etc.

This proposal would not only make a consistent syntax across all
objects, but train the programmer to *think* modularly in the sense of
having a community of re-usable object.  I.e. "What should I do if
another object passes me something?".  No one thinks this now, because
the programmer expects new developers to learn *their* interface!

Mark



More information about the Python-ideas mailing list