Can global variable be passed into Python function?

Ben Finney ben+python at benfinney.id.au
Fri Feb 28 19:02:46 EST 2014


Marko Rauhamaa <marko at pacujo.net> writes:

> Mark Lawrence <breamoreboy at yahoo.co.uk>:
>
> > http://c2.com/cgi/wiki?SwitchStatementsSmell
>
> Your brief summary, please, Mark?
>
> Anyway, the first 1000 lines or so that I managed to read from that page
> stated a valid principle, which however doesn't invalidate the existence
> of a switch statement.

The first sentence on that page explains that it's describing a “code
smell”, with a link to the page which explains that term
<URL:http://c2.com/cgi/wiki?CodeSmell>. Did you read that page?

A code smell is an indication that something is wrong in the code. That
indication is not 100% accurate; the point is that it's accurate enough
to be worth further scrutiny to find what problem may be causing the smell.

> However, like all other maxims, that principle, too, has exceptions.

Of course. That's the point of describing something as a “code smell”:
it may have exceptions where the smell does not indicate an actual
problem, but those are not the normal case where the smell is
encountered. More often, it indicates a problem that should be fixed.

-- 
 \        “Members of the general public commonly find copyright rules |
  `\        implausible, and simply disbelieve them.” —Jessica Litman, |
_o__)                                              _Digital Copyright_ |
Ben Finney




More information about the Python-list mailing list