Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #41442

Re: [Python-ideas] Message passing syntax for objects

Path csiph.com!usenet.pasdenom.info!dedibox.gegeweb.org!gegeweb.eu!gegeweb.org!de-l.enfer-du-nord.net!feeder2.enfer-du-nord.net!cs.uu.nl!news.stack.nl!newsfeed.xs4all.nl!newsfeed2.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail
Return-Path <bsk16@case.edu>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.001
X-Spam-Evidence '*H*': 1.00; '*S*': 0.00; 'subject:: [': 0.03; 'received:209.85.223': 0.03; 'syntax': 0.03; 'subject:Python': 0.05; 'classes,': 0.05; 'list?': 0.07; 'objects,': 0.07; 'received:209.85.223.198': 0.07; 'python': 0.09; 'abstraction': 0.09; 'programmer': 0.11; 'passing': 0.15; 'add,': 0.16; 'expects': 0.16; 'grouped': 0.16; 'janssen': 0.16; 'operation.': 0.16; 're-usable': 0.16; 'sorts': 0.16; 'subject:ideas': 0.16; 'mon,': 0.16; 'wrote:': 0.17; 'element': 0.17; 'passes': 0.17; '>>>': 0.18; 'subject:] ': 0.19; 'sort': 0.21; 'bit': 0.21; 'object.': 0.22; 'defined': 0.22; 'posted': 0.22; 'machine': 0.24; 'pass': 0.25; 'header:In-Reply-To:1': 0.25; 'developers': 0.26; 'am,': 0.27; 'question': 0.27; 'c++': 0.27; 'i.e.': 0.27; 'message-id:@mail.gmail.com': 0.27; 'interface': 0.27; "doesn't": 0.28; '>>>>': 0.29; 'methods.': 0.29; 'oop': 0.29; 'thinks': 0.29; "we're": 0.30; 'train': 0.30; 'function': 0.30; 'on,': 0.30; 'sense': 0.31; 'implement': 0.32; 'shift': 0.33; 'to:addr:python- list': 0.33; 'another': 0.33; 'changed': 0.34; 'received:google.com': 0.34; 'consistent': 0.35; 'community': 0.35; 'pm,': 0.35; 'received:209.85': 0.35; 'something': 0.35; 'there': 0.35; 'add': 0.36; 'but': 0.36; 'wanted': 0.36; '(i.e.': 0.36; 'should': 0.36; 'why': 0.37; 'received:209': 0.37; 'mark': 0.38; 'mean': 0.38; 'object': 0.38; 'some': 0.38; 'talk': 0.38; 'delete': 0.38; 'instead': 0.39; 'to:addr:python.org': 0.39; 'space': 0.39; 'hello,': 0.39; 'where': 0.40; 'subject:-': 0.40; 'telling': 0.61; 'back': 0.62; 'different': 0.63; 'behavior': 0.64; 'our': 0.65; 'decided': 0.65; 'natural': 0.65; 'engage': 0.65; 'subject.': 0.65; 'computers': 0.69; 'benefit': 0.70; '"what': 0.84; '2013': 0.84; 'calls,': 0.84
X-Google-DKIM-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:mime-version:x-received:in-reply-to:references:date :message-id:subject:from:to:content-type:x-gm-message-state; bh=CxZp0idv6wdd5pGifmkkzOdl/XmOfXloejdAVdfJujo=; b=bIw36ARtFOOPk5av938bLbPKCGS851Ai4NPgpjgrlV6jvYPKp5TKDTwPB+x4txWe5T kVPqw5vnisuE7QzBTQ+XbnftQf8SW2EmQBBLfRzMdT7GsQMk/TP24F4a8Fsx0u2ip8yx a+uW+Fupm2Wr09oXR/INWhxN47nIhKp6tTi24Wg71sUblqCwUE87I3P7+Yk8upj38p0i Rtis3Dga9ANysnnPrNdyzdXx/3g77QeUmjC3SN+B0kvgXbpehvpAZvt93TxTSRf6yjNl 6zlAiXL0XogdbfOh40Q1M0Pcb63lzQFYwvQvBeTby/2CoYGQeV0+QgvfFfeEryFWl5yf Q0/g==
X-Received by 10.60.7.67 with SMTP id h3mr7197995oea.69.1363629866224; Mon, 18 Mar 2013 11:04:26 -0700 (PDT)
MIME-Version 1.0
X-Received by 10.60.7.67 with SMTP id h3mr7197992oea.69.1363629866142; Mon, 18 Mar 2013 11:04:26 -0700 (PDT)
In-Reply-To <CAMjeLr9umOKdaKjDOx0b-p5aonYc8xj79NH8wEwD3tfAD-B-qQ@mail.gmail.com>
References <CAMjeLr_dBCSL9VGjrW6wJjMDhLWFdxWqGWw+5MXTfo8+x9yfYw@mail.gmail.com> <CAN-Kwu0FHJcG-fPy6TsXtgJ2+0EgtMOad88kgU=iqA+oNfyVsw@mail.gmail.com> <5146A76D.1020205@canterbury.ac.nz> <CAMjeLr8ip4bbA-KCfvzeOCb2mk=_3B1eB1FF-tsc4Xz9rgWboQ@mail.gmail.com> <CAMjeLr9umOKdaKjDOx0b-p5aonYc8xj79NH8wEwD3tfAD-B-qQ@mail.gmail.com>
Date Mon, 18 Mar 2013 11:04:25 -0700
Subject Re: [Python-ideas] Message passing syntax for objects
From Benjamin Kaplan <benjamin.kaplan@case.edu>
To python-list@python.org
Content-Type text/plain; charset=UTF-8
X-Gm-Message-State ALoCoQmKj3Zh/XftZ7NMwF5z758LvB+MOvR+Je4sG+TqIt2A3fWnp4r8jMt1aHeoam1YfD7gsVLnQF++DtZIgucqZUDd7znWvhRfcI/3nDtbgdRDEVKnJV5ok06y/t1QBCOmhnLRewBRAFLRqwbQylIZC+kYUJCb4Q==
X-Junkmail-Whitelist YES (by domain whitelist at mpv2.tis.cwru.edu)
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.15
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <http://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list/>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <http://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.3462.1363629877.2939.python-list@python.org> (permalink)
Lines 50
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1363629877 news.xs4all.nl 6871 [2001:888:2000:d::a6]:57693
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:41442

Show key headers only | View raw


On Mon, Mar 18, 2013 at 10:18 AM, Mark Janssen
<dreamingforward@gmail.com> wrote:
>> Ian Cordasco wrote:
>>>
>>> On Sun, Mar 17, 2013 at 11:53 PM, Mark Janssen
>>> <dreamingforward@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
> --

You're dreaming of a utopia where computers just read our minds and
know what we're thinking. So what if I can pass 42 into an object.
What do I intend to happen with that 42? Do I want to add the element
to a list? Access the 42nd element? Delete the 42nd element? Let the
object pick a behavior at random? Clearly there must be some sort of
behavior defined for passing a message into an object. And now we're
back to learning the interface that the programmer designed. Only now,
instead of having different types of behavior grouped together into
classes, we have to use a different object for each operation. So
what's the benefit of that over having the object implement the
__call__ method?

Also, why would we re-use the bit shift operators for message passing?
Just because C++ decided to overload the existing operators to mean
reading into and writing out of a stream doesn't mean it's a good
idea.

Back to comp.lang.python | Previous | Next | Find similar | Unroll thread


Thread

Re: [Python-ideas] Message passing syntax for objects Benjamin Kaplan <benjamin.kaplan@case.edu> - 2013-03-18 11:04 -0700

csiph-web