Here I am again, same old arguments

Tim Roberts timr at
Sat Oct 15 19:37:04 CEST 2005

Steven D'Aprano <steve at> wrote:
>Global variables aren't *entirely* bad. I use them myself, sometimes for
>constants (well, pseudo-constants -- Python doesn't enforce constants) and
>short, quick 'n' dirty throw away code.
>But in general, as your code gets bigger and more complicated, using
>global variables gets more dangerous, unreliable, harder to debug, and
>generally a bad idea. Let me show you some examples.

This gets my vote for post-of-the-week.  If there were a bulletin board
that was required reading for beginning programmers, this would definitely
need to be tacked up to it.

Nice work.
- Tim Roberts, timr at
  Providenza & Boekelheide, Inc.

More information about the Python-list mailing list