Path: csiph.com!usenet.pasdenom.info!weretis.net!feeder1.news.weretis.net!feeder.erje.net!newsfeed.xs4all.nl!newsfeed5.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.003 X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; 'languages,': 0.03; 'instance,': 0.05; 'subject:Python': 0.05; '(especially': 0.07; 'c++,': 0.07; 'python': 0.08; 'stack,': 0.09; 'stack.': 0.09; 'item)': 0.16; 'mainstream': 0.16; 'stack)': 0.16; 'cc:addr :python-list': 0.16; 'syntax': 0.16; 'language': 0.16; 'wrote:': 0.18; 'java,': 0.19; '(which': 0.19; 'seems': 0.20; 'programming': 0.20; 'cc:no real name:2**0': 0.21; 'header:In-Reply-To:1': 0.22; 'statement': 0.23; "shouldn't": 0.23; 'steve': 0.24; 'stack': 0.24; 'cc:2**0': 0.26; 'code': 0.26; 'example': 0.29; 'cc:addr:python.org': 0.29; 'pm,': 0.29; 'lines': 0.30; 'semantics': 0.30; 'pretty': 0.31; 'do.': 0.31; "isn't": 0.33; 'header:User-Agent:1': 0.33; 'push': 0.37; 'but': 0.37; 'difference': 0.38; 'received:128': 0.38; 'some': 0.38; 'point': 0.40; 'missing': 0.40; 'follow': 0.61; 'type': 0.61; 'more': 0.61; 'is.': 0.63; 'course.': 0.66; 'direct': 0.67; 'natural': 0.67; 'to:addr:yahoo.com': 0.83; 'howell': 0.84; 'imperative.': 0.84; 'strongest': 0.84 Date: Wed, 21 Mar 2012 11:22:01 -0500 From: Evan Driscoll User-Agent: Mozilla/5.0 (X11; U; Linux i686 (x86_64); en-US; rv:1.9.2.17) Gecko/20110414 Thunderbird/3.1.10 MIME-Version: 1.0 To: Steve Howell Subject: Re: Re: Python is readable References: <4f612b19$0$1379$4fafbaef@reader2.news.tin.it> <50e9ceec-40f1-4ead-b2b6-87328b30d084@ow8g2000pbc.googlegroups.com> <4f691f3d$0$29981$c3e8da3$5496439d@news.astraweb.com> <87d386lmai.fsf@benfinney.id.au> <8a77bf8d-b12f-442b-a1a3-479b5d66d366@tx8g2000pbc.googlegroups.com> <6af70db0-dc4a-48ee-9ee2-1a934846d5f2@r2g2000pbs.googlegroups.com> In-Reply-To: <6af70db0-dc4a-48ee-9ee2-1a934846d5f2@r2g2000pbs.googlegroups.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Seen-By: mailfromd 4.1 sandstone.cs.wisc.edu Cc: python-list@python.org X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 33 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1332346941 news.xs4all.nl 6889 [2001:888:2000:d::a6]:57645 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:21988 On 01/-10/-28163 01:59 PM, Steve Howell wrote: > Code shouldn't necessarily follow the example of English prose, but it > seems that English has had some influence: > > 1 push(stack, item) # Push on the stack the item > 2 push(item, stack) # Push the item on the stack > 3 stack.push(item) # On the stack, push the item > 4 stack item push # On the stack, take the item and push it > 5 item stack push # Take the item and on the stack, push the > former. > 6 item push stack # Take the item; push it on the stack. > > The first three ways are the most common ways of arranging the grammar > in mainstream programming languages, and they are also the three most > natural ways in English (no pronouns required). > > #1/2 are imperative. #3 is OO. In my opinion, people who make statements such as "#1/2 are imperative, #3 is OO" are missing pretty much the entire point of what OO is. OO is much more about semantics and the way code is structured. The difference between #1/2 (especially #1, of course) and #3 is surface-level syntax only. About the strongest statement you can make along those lines is that #3 will allow you to do dynamic dispatch on the type of 'stack' while #1/2 won't, but even that isn't true of course. For instance, CLOS will let you write '(push stack item)' (which is the direct analogy in that language to #1) and do even more powerful dynamic dispatch than what a language like C++, Java, or Python will let you do. Evan