The Python ecosystem

The hard part about getting started with Python is not the language but the ecosystem. It’s easy to find good references on the Python language, but it’s harder to learn what packages are available, how to install them, etc. That was my experience, and Miz Nazim started with a similar observation in his article Python Ecosystem: An Introduction.

Maybe its always harder to learn a language’s ecosystem than the language itself. But I think this was the case for me with Python more than with other languages I’ve used. I wish I’d found Nazim’s article or something like it when I was learning Python.

Related links

Bing Crosby science

In a recent interview, Gary Taubes calls picking data that support your conclusion “Bing Crosby science.” This comes from a song by Bing Crosby that begins “You’ve got to accentuate the positive, eliminate the negative.”

Taubes uses the phrase to refer specifically to epidemiology, though it applies to all science. He credits “a Scottish researcher” with coining the phrase, but doesn’t say any more about who this researcher was.

Related post: Amputating reality

An array of hammers

In a comment on the previous post, vonjd brought up the famous quote from Abraham Maslow:

It is tempting, if the only tool you have is a hammer, to treat everything as if it were a nail.

Sometimes you don’t just have a hammer, you have an array of hammers. You have rock hammers, claw hammers, and sledge hammers, all in numerous sizes. You have a variety of wooden and rubber mallets too. You’ve even got a gavel. Because you have such an impressive collection of specialized hammers, you think you’re broad in your problem solving, but your basic instinct is still only to beat on things.

Related posts

Global variables

Here’s an answer I gave on Stack Overflow to someone asking when it’s OK to use global variables.

Here’s a cheap way to get rid of all global variables: put all your code in one big fat class and change the global variables to member variables. Nothing has changed as far as the maintainability of your code, but technically it no longer has global variables.

It’s better to talk about size of scope than whether or not something is global. “Global” just means maximum scope. Instead of saying “global variables are bad,” I think it’s more helpful to say “minimize variable scope.”

A global variable in a 100-line program has a scope of 100 lines. But a member variable in a 1000-line class has a scope of 1000 lines. The latter may be worse.