From the monthly archives:

December 2011

The Python ecosystem

by John on December 7, 2011

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:

Getting started with SciPy
Sage beginner’s guide
Python is a voluntary language
SciPyTip on Twitter

{ 13 comments }

Midweek miscellany

by John on December 6, 2011

Science

Why are scientific retractions increasing?
Detecting rings around exoplanets
How tire pressure sensors work

Work

Doing a job

Math

A primer on Bezier curves
Number of cycles in a random permutation

Programming

Seven habits of effective text editing
Scott Hanselman’s tool list for Windows
Unix tool tips
Impractical programming

History

The Billy Possum
Revisiting Alan Turing

Humor

{ 2 comments }

Bing Crosby science

by John on December 5, 2011

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

{ 3 comments }

An array of hammers

by John on December 2, 2011

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:

Doing good work with bad tools
Just an approximation
Redbelt problem solving

{ 7 comments }

Amputating reality

by John on December 1, 2011

“If you just rely on one model, you tend to amputate reality to make it fit your model.” — David Brooks

Related post: Advantages of crude models

{ 6 comments }

Global variables

by John on December 1, 2011

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.

{ 14 comments }