Path: csiph.com!usenet.pasdenom.info!weretis.net!feeder4.news.weretis.net!rt.uk.eu.org!newsfeed.xs4all.nl!newsfeed3a.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.000 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'python.': 0.02; 'python,': 0.02; 'subject:Python': 0.06; 'class,': 0.07; 'differently': 0.07; 'discard': 0.07; 'javascript,': 0.07; 'variables': 0.07; '(those': 0.09; 'classes.': 0.09; 'meaningful': 0.09; 'php,': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'ruby,': 0.09; 'variables.': 0.09; '\xe2\x80\x94': 0.09; 'python': 0.11; 'mostly': 0.14; 'assigned,': 0.16; 'assumptions': 0.16; 'binding,': 0.16; 'declared': 0.16; 'finney': 0.16; 'function?': 0.16; 'modules.': 0.16; 'received:80.91.229.3': 0.16; 'received:plane.gmane.org': 0.16; 'variables,': 0.16; 'java,': 0.16; 'language': 0.16; 'wrote:': 0.18; 'pointed': 0.19; "python's": 0.19; 'header:User-Agent:1': 0.23; 'instead.': 0.24; 'received:comcast.net': 0.24; 'question': 0.24; 'pass': 0.26; 'header:X-Complaints-To:1': 0.27; 'header:In-Reply-To:1': 0.27; 'chris': 0.29; 'int,': 0.31; 'values.': 0.31; 'writes:': 0.31; 'there.': 0.32; 'languages': 0.32; "we're": 0.32; 'bugs': 0.33; 'entirely': 0.33; 'not.': 0.33; 'comment': 0.34; 'classes': 0.35; 'but': 0.35; 'c++': 0.36; 'functions.': 0.36; 'keyword': 0.36; 'much.': 0.36; 'var': 0.36; 'useful': 0.36; 'expected': 0.38; 'ben': 0.38; 'to:addr:python-list': 0.38; 'pm,': 0.38; 'does': 0.39; 'to:addr:python.org': 0.39; 'enough': 0.39; 'skip:p 20': 0.39; 'received:org': 0.40; 'most': 0.60; 'discuss': 0.62; 'term': 0.63; 'subject:The': 0.64; 'different': 0.65; 'skip:\xe2 10': 0.65; 'containing': 0.69; 'fact,': 0.69; 'subjectcharset:utf-8': 0.72; '8bit%:43': 0.74; 'introduce': 0.78; 'subject:have': 0.80; 'all;': 0.84; 'batchelder': 0.84; 'confusing': 0.84 X-Injected-Via-Gmane: http://gmane.org/ To: python-list@python.org From: Ned Batchelder Subject: Re: The =?UTF-8?B?4oCcZG9lcyBQeXRob24gaGF2ZSB2YXJpYWJsZXM/4oCdIGQ=?= =?UTF-8?B?ZWJhdGU=?= Date: Tue, 06 May 2014 21:19:36 -0400 References: <235C4BFA-9770-481A-9FCF-21C3F036769C@gmail.com> <5368681D.8070602@islandtraining.com> <85zjiuea37.fsf_-_@benfinney.id.au> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Gmane-NNTP-Posting-Host: c-50-133-228-126.hsd1.ma.comcast.net User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:24.0) Gecko/20100101 Thunderbird/24.5.0 In-Reply-To: <85zjiuea37.fsf_-_@benfinney.id.au> 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: 57 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1399425590 news.xs4all.nl 2956 [2001:888:2000:d::a6]:32774 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:71001 On 5/6/14 7:55 PM, Ben Finney wrote: > Ned Batchelder writes: > >> This meme bugs me so much. Python has variables. They work differently >> than variables in C. > > Which is why it's useful to intervene right at the start when someone > comes in with assumptions about “variables”; it's better that they > discard that baggage and learn about reference binding, instead. Where do you draw the line? Python ints work differently than C ints, but we don't seem to mind using the same word for them. Same for strings and functions. Python's classes work differently than C++ or Java's, but we don't say that Python has no classes. And let's not discuss Lisp's lists, Haskell's functions, or Modula-2's modules. So many terms are used and re-used, and each language has differences. Why is "variable" sacrosanct and can only be used to describe C semantics, but we're OK reusing class, int, and function? > >> In fact, they work by having names bound to values. > > My position is that this concept is sufficiently different to what most > newcomers to Python mean by “variable” (those who have the term at all; > and for those who don't, no need to introduce potentially-confusing > terms) that it's better to avoid that term entirely and immediately use > more-accurate terminology. > >> If you want to insist that Python has no variables, you will have to >> also say that neither do Javascript, Ruby, Java, PHP, etc. > > I don't know enough Ruby to comment there. For Java, Javascript, PHP, > they *do* have variables that work pretty much as expected by these > newcomers: the variables are declared and exist before a value is > assigned, they have the “box containing a value” conceptual model (as > contrasted with Python's “value with sticky-notes attached” model), the > “how do I pass by reference or by value?” question is meaningful — all > of these are significantly different in Python, so the term “variable” > is useful in those other languages but mostly just a confusing obstacle > in learning Python. As Chris A. has pointed out, Javascript works like Python, and not much like C. > >> And if Javascript has no variables, what does the var keyword mean? > > Exactly; JavaScript *does* have variables, in the ways Python does not. > -- Ned Batchelder, http://nedbatchelder.com