Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!feeds.phibee-telecom.net!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.003 X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; 'languages,': 0.04; 'freelance': 0.05; 'subject:Python': 0.06; 'arguments': 0.09; 'used.': 0.09; 'developer': 0.10; 'cc:addr:python-list': 0.11; 'python': 0.11; 'received:209.85.218': 0.14; 'thread': 0.14; "wouldn't": 0.14; '7:35': 0.16; 'does,': 0.16; 'globals': 0.16; 'globals.': 0.16; 'scripts.': 0.16; 'to:addr:pearwood.info': 0.16; 'to:addr:steve+comp.lang.python': 0.16; "to:name:steven d'aprano": 0.16; 'variables:': 0.16; 'wrote:': 0.18; 'code.': 0.18; 'module': 0.19; 'trying': 0.19; 'passing': 0.19; 'thu,': 0.19; 'cc:addr:python.org': 0.22; 'fine': 0.24; 'java': 0.24; 'cc:2**0': 0.24; 'cc:no real name:2**0': 0.24; '>': 0.26; 'header:In- Reply-To:1': 0.27; "doesn't": 0.30; 'dec': 0.30; 'message- id:@mail.gmail.com': 0.30; 'url:mailman': 0.30; 'url:wiki': 0.31; 'are.': 0.31; "d'aprano": 0.31; 'steven': 0.31; 'probably': 0.32; 'url:python': 0.33; 'received:209.85': 0.35; 'but': 0.35; 'received:google.com': 0.35; 'there': 0.35; 'url:listinfo': 0.36; 'url:org': 0.36; 'should': 0.36; 'received:209': 0.37; 'problems': 0.38; 'needed': 0.38; 'pm,': 0.38; 'expect': 0.39; 'bad': 0.39; 'url:mail': 0.40; 'how': 0.40; 'even': 0.60; 'solve': 0.60; 'course': 0.61; 'here': 0.66; 'believe': 0.68; 'production': 0.68; 'wish': 0.70; 'from:addr:admin': 0.78; 'introduce': 0.78; 'dozens': 0.84; 'url:asia': 0.84; 'problems?': 0.91; 'luck': 0.93 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=laFI2Jwr0Sy0rMpt5+93zTYegStPDmjJTEjtiwkQd8M=; b=fG2mtteDAjZaFTYP0EE62yKzUpU4aGs8bTe50wKS19aw4HkJ5jWxEsfcFun5fqMoIo BRLJ1U3jaQc32LV5Izpc94e05wIGVG6j5WlRI28LzdjEDCT2gDZwOWpq4LOiD4/Hzn3Z BJfx3QI/wJDcEbemQzXDZtqTSsI6ZvH8wqqwJyU8kyXDLgGmCvXbiibnNwP2ll96D07b v7TPPMsoTyaeEn3HsHNFbbSLxnsxFOXxUmaRD5tuo+RcGOFaWYKt0uoJwMAl/6zAPeEW Zk7qIC9eSgrElRbvf79qoKps5oQ8JfNMlNo1BgLoslcHkNdlBorIzeealoA9jzLVHwJG RFVA== X-Gm-Message-State: ALoCoQkHEfIxDczfrCjTgaEbLROc4qhO4n+8JCLRCb2W1gwVe02e38MUDu+3X5E5P7fz94WVLkhF MIME-Version: 1.0 X-Received: by 10.182.22.164 with SMTP id e4mr7027339obf.21.1417703904495; Thu, 04 Dec 2014 06:38:24 -0800 (PST) X-Originating-IP: [49.144.140.116] In-Reply-To: <54804719$0$12988$c3e8da3$5496439d@news.astraweb.com> References: <54804719$0$12988$c3e8da3$5496439d@news.astraweb.com> Date: Thu, 4 Dec 2014 22:38:24 +0800 Subject: Re: Python handles globals badly. From: jtan To: "Steven D'Aprano" Content-Type: multipart/alternative; boundary=001a11c35ddc9fd373050964e986 X-Mailman-Approved-At: Thu, 04 Dec 2014 16:57:54 +0100 Cc: python-list@python.org 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: 92 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1417708675 news.xs4all.nl 2945 [2001:888:2000:d::a6]:38480 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:81914 --001a11c35ddc9fd373050964e986 Content-Type: text/plain; charset=UTF-8 I wish him all the luck while having sleep deprivation trying to solve production issues :) On Thu, Dec 4, 2014 at 7:35 PM, Steven D'Aprano < steve+comp.lang.python@pearwood.info> wrote: > jtan wrote: > > > How can Skybuck use so much globals. Wouldn't that introduce a lot of > > thread safety problems? > > Of course it would. But I expect that Skybuck probably doesn't even know > what threads are. Or if he does, he probably doesn't believe that they > should be used. > > Thread safety is just the start of the problems with global variables: > > http://c2.com/cgi/wiki?GlobalVariablesAreBad > > Globals in Python are less bad than in many other languages, since they are > localised to a single module only. And the use of a few globals here and > there as needed is perfectly fine for small scripts. But using dozens of > them to avoid passing arguments to functions, that's just awful code. > > > -- > Steven > > -- > https://mail.python.org/mailman/listinfo/python-list > -- Freelance Grails and Java developer --001a11c35ddc9fd373050964e986 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
I wish him all the luck while having sleep deprivation try= ing to solve production issues :)

<= div class=3D"gmail_quote">On Thu, Dec 4, 2014 at 7:35 PM, Steven D'Apra= no <steve+comp.lang.python@pearwood.info>= wrote:
jtan wrote:

> How can Skybuck use so much globals. Wouldn't that introduce a lot= of
> thread safety problems?

Of course it would. But I expect that Skybuck probably doesn't e= ven know
what threads are. Or if he does, he probably doesn't believe that they<= br> should be used.

Thread safety is just the start of the problems with global variables:

= http://c2.com/cgi/wiki?GlobalVariablesAreBad

Globals in Python are less bad than in many other languages, since they are=
localised to a single module only. And the use of a few globals here and there as needed is perfectly fine for small scripts. But using dozens of them to avoid passing arguments to functions, that's just awful code.

--
Steven

--
https://mail.python.org/mailman/listinfo/python-list



--
Freelance=C2=A0G= rails and Java=C2=A0developer
--001a11c35ddc9fd373050964e986--