Here’s another one to throw onto the “how to ask questions” heap. Sometimes, somebody asks a question on Stack Overflow that amounts to this:
What is the best way to shoot myself in the foot?
It is very tempting of course to answer:
Choose which foot you’d like to shoot, aim the gun at it, then pull the trigger.
Really, however, I usually try something more along those lines:
Shooting oneself in the foot is rarely something you’ll want to do. It can have serious consequences on your health, and in particular on your ability to use your foot afterwards. Shooting any part of your body (or other people’s for that matter) is in general not something I can recommend.
What exactly are you trying to achieve by shooting yourself in the foot?
Explain, then ask for more information. And the answer to this is…
There’s a really scary spider on my foot.
I need to drill a hole in the floor under where my foot is, to get some cables from my basement.
Now, we can provide some useful answers that will hopefully avoid the whole gun shooting thing.
The problem with the initial question is that the author assumes he has figured out the best solution to his problem. He believes his problem to just be a technical hurdle, whereas they are a sign that they’re doinitrong.
While there is a technically good answer to the question, we know that we can do better. What we need to find out is what the questioner’s problem is, not what his question is.
Sometimes, however, it gets weirder:
What is the best way to shoot myself in the foot with a power drill?
If somebody asks you this, resist the urge to answer
Despite the superficial resemblance between a handgun and a power drill, you can’t shoot yourself in the foot with the latter. Buy a gun, then try again.
Once again, you must first understand what the questioner is really trying to achieve, and then solve that problem in a sane way…