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


Groups > comp.lang.python > #81825

Re: Python handles globals badly.

Path csiph.com!usenet.pasdenom.info!aioe.org!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 <rosuav@gmail.com>
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; 'python.': 0.02; 'languages,': 0.04; 'subject:Python': 0.06; 'variables': 0.07; 'variables.': 0.09; 'cc:addr:python-list': 0.11; 'python': 0.11; '"global"': 0.16; 'behave': 0.16; 'did,': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'globals': 0.16; 'language': 0.16; 'wrote:': 0.18; 'code.': 0.18; 'wed,': 0.18; 'programming': 0.22; 'cc:addr:python.org': 0.22; 'stick': 0.24; 'cc:2**0': 0.24; 'header:In-Reply-To:1': 0.27; 'point': 0.28; 'dec': 0.30; 'especially': 0.30; 'message- id:@mail.gmail.com': 0.30; "i'm": 0.30; 'code': 0.31; 'fighting': 0.31; 'flying': 0.31; 'front': 0.32; 'quite': 0.32; 'worked': 0.33; 'maybe': 0.34; 'something': 0.35; 'but': 0.35; 'received:google.com': 0.35; 'two': 0.37; 'pm,': 0.38; 'rather': 0.38; 'expect': 0.39; 'either': 0.39; 'how': 0.40; "you'll": 0.62; "you've": 0.63; 'telling': 0.64; 'experience.': 0.67; 'strengths': 0.84; 'to:none': 0.92; 'hand,': 0.93
DKIM-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:cc :content-type; bh=V2H5LtOJIjiHFMBvxssX3VHPF8PNJpz5AfJ7CZx/h9Q=; b=cOYO5ICAq9SkQFcbODfBk5hIZbYTZUxtHskTaG3dcbVDi4UllEbaFcvctFoKzf7kUt lJbqd3lGo/Q7AXNBh0maoFj1xd2A67yHaD2f3GHYzmHbDHagvuXwmFpE5fPPOXWLHTJe DvMB88h7BDk3k4EQzJSQYAOhQ6knAA4RqJO3c/z+Q1rIF9ZO2swyBAqmSgS6gdcoOz5M djawhGJiI1ys8F4y3UtAWVppyTHUOqC3gm8jRHt90+HFOnSlSo15DqGquShWQO712h9x nyS3u6JTJQu4rGmo2H+Uc/nrlcvJgsV/MfHyrPnRz0WD2K92BnK8XtazFeUXGeDLqH8f iqgw==
MIME-Version 1.0
X-Received by 10.50.61.140 with SMTP id p12mr6493674igr.34.1417574135942; Tue, 02 Dec 2014 18:35:35 -0800 (PST)
In-Reply-To <c3363$547e74fe$5419aafe$24179@news.ziggo.nl>
References <c3363$547e74fe$5419aafe$24179@news.ziggo.nl>
Date Wed, 3 Dec 2014 13:35:35 +1100
Subject Re: Python handles globals badly.
From Chris Angelico <rosuav@gmail.com>
Cc "python-list@python.org" <python-list@python.org>
Content-Type text/plain; charset=UTF-8
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 <https://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 <https://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.16507.1417574145.18130.python-list@python.org> (permalink)
Lines 22
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1417574145 news.xs4all.nl 2933 [2001:888:2000:d::a6]:59807
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:81825

Show key headers only | View raw


On Wed, Dec 3, 2014 at 1:27 PM, Skybuck Flying <skybuck2000@hotmail.com> wrote:
> I don't need snot telling me how to program after 20 years of programming
> experience.
>
> This is so far the only thing pissing me off in python.
>
> Now I have to declare "global" in front of these variables every where I
> want to use em:

Well, I'm not snot, and I also have 20+ years' programming
experience... and I'm telling you that using that many globals is a
poor way to write code. Especially having so many separate, but
related, variables. If your two decades' experience were at all like
mine, you'll have worked with quite a lot of languages, and you'll
know to code to a language's strengths rather than fighting against
it. On the other hand, if you've been working with one language for
twenty years, then maybe you'd do better to stick to it than to try to
learn something new. But either way, don't expect Python to behave
like <insert other language here>, because if it did, what would be
the point of having both?

ChrisA

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


Thread

Python handles globals badly. "Skybuck Flying" <skybuck2000@hotmail.com> - 2014-12-03 03:27 +0100
  Re: Python handles globals badly. Chris Angelico <rosuav@gmail.com> - 2014-12-03 13:35 +1100
  RE: Python handles globals badly. "Clayton Kirkwood" <crk@godblessthe.us> - 2014-12-02 18:53 -0800
  Re: Python handles globals badly. Michael Torrie <torriem@gmail.com> - 2014-12-02 20:13 -0700
    Re: Python handles globals badly. "Skybuck Flying" <skybuck2000@hotmail.com> - 2014-12-03 05:32 +0100
      Re: Python handles globals badly. Chris Angelico <rosuav@gmail.com> - 2014-12-03 15:42 +1100
      Re: Python handles globals badly. Dave Angel <davea@davea.name> - 2014-12-03 00:02 -0500
      Re: Python handles globals badly. Michael Torrie <torriem@gmail.com> - 2014-12-02 22:23 -0700
        Re: Python handles globals badly. Marko Rauhamaa <marko@pacujo.net> - 2014-12-03 08:52 +0200
          Re: Python handles globals badly. Joel Goldstick <joel.goldstick@gmail.com> - 2014-12-03 02:17 -0500
      Re: Python handles globals badly. Joshua Landau <joshua@landau.ws> - 2014-12-03 13:07 +0000
      Re: Python handles globals badly. mm0fmf <none@mailinator.com> - 2014-12-03 18:04 +0000
        Re: Python handles globals badly. sohcahtoa82@gmail.com - 2014-12-03 10:16 -0800
          Re: Python handles globals badly. Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2014-12-04 11:57 +1100
            Re: Python handles globals badly. Chris Angelico <rosuav@gmail.com> - 2014-12-04 12:10 +1100
            Re: Python handles globals badly. Joel Goldstick <joel.goldstick@gmail.com> - 2014-12-03 20:23 -0500
          Re: Python handles globals badly. Dennis Lee Bieber <wlfraed@ix.netcom.com> - 2014-12-03 22:57 -0500
          Re: Python handles globals badly. Michael Torrie <torriem@gmail.com> - 2014-12-03 21:11 -0700
  Re: Python handles globals badly. Ben Finney <ben+python@benfinney.id.au> - 2014-12-03 14:21 +1100
  Re: Python handles globals badly. "Skybuck Flying" <skybuck2000@hotmail.com> - 2014-12-03 05:17 +0100
    Re: Python handles globals badly. Chris Angelico <rosuav@gmail.com> - 2014-12-03 15:36 +1100
    Re: Python handles globals badly. Tony the Tiger <tony@tiger.invalid> - 2014-12-04 20:27 +0000
  Re: Python handles globals badly. Mark Lawrence <breamoreboy@yahoo.co.uk> - 2014-12-03 12:35 +0000
    Re: Python handles globals badly. "Skybuck Flying" <skybuck2000@hotmail.com> - 2014-12-04 00:02 +0100
      Re: Python handles globals badly. Mark Lawrence <breamoreboy@yahoo.co.uk> - 2014-12-04 01:32 +0000
      Re: Python handles globals badly. Dennis Lee Bieber <wlfraed@ix.netcom.com> - 2014-12-03 23:01 -0500
      Re: Python handles globals badly. jtan <admin@grails.asia> - 2014-12-04 13:03 +0800
        Re: Python handles globals badly. Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2014-12-04 22:35 +1100
          Re: Python handles globals badly. jtan <admin@grails.asia> - 2014-12-04 22:38 +0800
      Re: Python handles globals badly. Mark Lawrence <breamoreboy@yahoo.co.uk> - 2014-12-04 10:24 +0000
      Re: Python handles globals badly. Chris Angelico <rosuav@gmail.com> - 2014-12-04 21:29 +1100
        Re: Python handles globals badly. Marko Rauhamaa <marko@pacujo.net> - 2014-12-04 14:51 +0200
          Re: Python handles globals badly. Dennis Lee Bieber <wlfraed@ix.netcom.com> - 2014-12-04 20:56 -0500
          Re: Python handles globals badly. William Ray Wing <wrw@mac.com> - 2014-12-04 23:17 -0500
      Re: Python handles globals badly. alister <alister.nospam.ware@ntlworld.com> - 2014-12-04 19:54 +0000
  Re: Python handles globals badly. Peter Pearson <pkpearson@nowhere.invalid> - 2014-12-03 20:31 +0000

csiph-web