Path: csiph.com!usenet.pasdenom.info!aioe.org!news.stack.nl!newsfeed.xs4all.nl!newsfeed3.news.xs4all.nl!xs4all!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.002 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'syntax': 0.04; 'argument': 0.05; 'subject:Python': 0.06; 'algorithms,': 0.07; 'assignment': 0.07; 'definitions': 0.07; 'variables': 0.07; 'calls.': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'statements': 0.09; 'python': 0.11; 'def': 0.12; 'language,': 0.12; 'language.': 0.14; 'barrier': 0.16; 'fits': 0.16; 'received:80.91.229.3': 0.16; 'received:plane.gmane.org': 0.16; 'roy': 0.16; 'simple.': 0.16; 'usable': 0.16; 'y):': 0.16; 'wrote:': 0.18; 'passing': 0.19; 'result.': 0.19; 'print': 0.22; 'header:User-Agent:1': 0.23; 'people,': 0.24; 'values': 0.27; 'header:X-Complaints-To:1': 0.27; 'header:In-Reply-To:1': 0.27; 'function': 0.29; 'am,': 0.29; "i'm": 0.30; 'container': 0.31; 'skip:( 50': 0.31; 'run': 0.32; 'running': 0.33; 'becomes': 0.33; 'programmers': 0.33; 'totally': 0.33; 'basic': 0.35; 'something': 0.35; 'really': 0.36; 'functions.': 0.36; 'programming,': 0.36; 'reality': 0.36; 'should': 0.36; 'two': 0.37; 'level': 0.37; 'list.': 0.37; 'to:addr:python-list': 0.38; 'to:addr:python.org': 0.39; 'enough': 0.39; 'received:org': 0.40; 'eventually': 0.60; 'everybody': 0.60; 'most': 0.60; 'new': 0.61; 'course': 0.61; 'further': 0.61; 'first': 0.61; 'name': 0.63; 'such': 0.63; 'subject:The': 0.64; 'levels': 0.65; 'talking': 0.65; 'charset:windows-1252': 0.65; 'smith': 0.68; 'special': 0.74; 'article': 0.77; 'subject:have': 0.80; 'write:': 0.91; 'hill': 0.95; 'taught': 0.96 X-Injected-Via-Gmane: http://gmane.org/ To: python-list@python.org From: "Neil D. Cerutti" Subject: Re: The =?windows-1252?Q?=93does_Python_have_variables=3F=94?= =?windows-1252?Q?_debate?= Date: Thu, 08 May 2014 10:47:42 -0400 References: <235C4BFA-9770-481A-9FCF-21C3F036769C@gmail.com> <5368681D.8070602@islandtraining.com> <85zjiuea37.fsf_-_@benfinney.id.au> <8738gmxgay.fsf@elektro.pacujo.net> Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-Gmane-NNTP-Posting-Host: jackman.norwich.edu User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:24.0) Gecko/20100101 Thunderbird/24.5.0 In-Reply-To: X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 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: 46 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1399560485 news.xs4all.nl 2919 [2001:888:2000:d::a6]:53292 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:71107 On 5/8/2014 8:41 AM, Roy Smith wrote: > In article , > Jerry Hill wrote: > >> thinking of python variables as having two parts -- names and values >> -- really can help people who are struggling to learn the language. > > There's many levels of learning, and we see them all on this list. > > For people who are just learning programming, and are learning Python as > their first language, we need to keep things simple. These are the > people who are still struggling to understand basic concepts such as > algorithms, loops, and the most fundamental data structures. For those > people, talking about variables as a container to hold a value is the > right level of abstraction. > > At some point, that model no longer fits reality well enough that it > becomes a barrier to further learning. When I write: > > def mutate(x, y): > x = 42 > y[0] = 42 > > x = 4 > y = [4] > > mutate(x, y) > print x, y > > and run it, unless I really understand about name binding and argument > passing, I'm going to be totally befuddled by the result. At that > point, I need to unlearn something I thought I understood, and that's > really hard (en.wikipedia.org/wiki/Principles_of_learning#Primacy). The "surprising" things can be demonstrated without using functions. Once assignment statements are mastered, the way argument passing works can be extrapolated. New programmers will have to further be taught about shadowing and scopes, while experienced programmers should already be up and running (until they try to get cute). Of course everybody has to eventually learn about the special syntax usable in function definitions and function calls. -- Neil Cerutti