Python handles globals badly.

jtan admin at grails.asia
Thu Dec 4 09:38:24 EST 2014


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 at 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 <http://grails.asia/> and Java <http://javadevnotes.com/>
 developer
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20141204/068d1738/attachment.html>


More information about the Python-list mailing list