Stuck on a problem? Here's when to ask for help
When you're stuck and can't solve a problem you need to decide when to ask to help. Part of becoming a better programmer is learning how to solve problems on your own, but at the same time you also want to learn from others. Wait too long and you've wasted your time; wait too little and you won't learn as much. The key is knowing how to steer between these two extremes.
It's worth emphasizing that when you get help does actually impact your learning. "How Learning Works" is an excellent book covering its title subject which I intend to review at some point. The book points to research that suggests getting immediate feedback impedes learning; a summary is available in this paper. So if you're trying to maximize learning you should not ask for help immediately.
On the other hand, merely spending a long time trying to solve a problem won't necessarily teach you much either. In many cases the information you need lives only in someone's head. Even if you are telepathic, reading someone's mind is merely an impolite method for asking someone's help: better to just ask directly. And when you could concievably solve something on your own it is often much faster to get help. Another set of eyes will quickly catch a typo your brain is filtering out.
When then should you ask? Depends how much progress you've made. In order to answer that question reasonably you therefore need to do some advance preparation, gathering information before you begin your task:
- You will need a vague estimate of how long the task ought to take. If you're a novice in the area it's best to get an estimate from an expert; ask them to estimate how long it would take them, then quadruple the estimate. If the expert says one hour then assume it will take you four. If you know what you're doing you can come up with an estimate on your own.
- You should also plan out your task: the necessary steps to achieve it, what order to do them in, and which steps you expect to be easier or harder. If you don't know how to do that then again ask for feedback from an expert. But don't just ask for a plan: also ask them to explain how they came up with the plan.
Given an estimate and a plan, if you eventually get stuck you will have some sense of how much progress you have made. The more progress you've made according to estimate and the planned steps the more time you should give yourself to solve the problem on your own. If you're on the second hour of your four hour estimate and you're still stuck on the first out of five steps then you should probably ask for help. If you're stuck on the last step of the plan and you have plenty of time to spare then it's worth trying to solve it on your own. Go for a walk, go home if it's the end of the day, try a different debugging method, etc..
How you ask for help is also important. Asking "how might you go about solving this problem" will help you learn much more than merely asking "what should I do next?" And it's often better to sit down together with a peer and go over the problem and how to solve it than to just ask a question and go back to your desk.
In short: estimate your work, make a plan, measure your progress, and ask for help when being stuck is noticeably impeding your progress. Stuck right now? Send me an email and tell me about it.