Getting Unstuck Without a Rubber Duck
Building software is a mostly creative endeavour, and as such, it sometimes resists progress. No matter how hard you try to push forward, if you are truly stuck, continuing on the same path is unlikely to work. Fortunately, there are a few different tricks you can use to get going again.
Take a rest
The easiest way I’ve found to get back on track is to take a break. When in the office this was often making a cup of tea or eating a snack in the break room. It could have been a ten-minute walk around the block, but if I’m honest, I have rarely tried this.
Working from home, I typically load the dishwasher or throw a load of laundry in the wash. If I have time, I might do a bit of yoga or exercise.
My favourite is a quick shower which seems to reset thoughts and stimulate creative thinking. Rinsing and drying my face in a bathroom sink is not nearly as effective, but in an office, it may be better than nothing.
If I have the time, or if I’m particularly stuck, a night of sleep can do wonders. I almost always have something else just as urgent to work on, so I’ll usually switch to that for the rest of the day.
Rubber ducking and alternatives
Every now and then I get so thoroughly stuck that no amount of taking breaks is going to help. Or sometimes a problem is urgent enough that waiting a day to sleep would be irresponsible. That’s when I bust out my rubber duck, at least metaphorically. I don’t actually have or want a rubber duck because there are several similar alternatives that work as well or better.
The one I use most often is to write an email asking an imaginary colleague for advice. If you treat it like a real work email, it forces you to rethink where you are from someone else’s perspective, and can often unlock some insights or surface some tidbits that got overlooked along the way. Writing an email also forces you to check your facts and go through your numbers again. This is harder when a rubber duck is waiting impatiently for you to finish your sentence. Another advantage is that you can use it in an environment where talking would be a nuisance to others.
Sometimes writing an email isn’t the best way to communicate a problem though. I have also drawn diagrams on whiteboards with similar results. There are lots of ways to communicate a problem, the key is that you make the effort to reframe it for the benefit of someone not directly involved.
If you are really really stuck, or your problem is really really important, it might be worthwhile to explain it to a real person. This can be a better first step if you’re working in areas you don’t know very well. It can also be helpful if you’re new to a team as it helps you demonstrate trust for your new peers and accelerates team building.
Remove all distractions
It’s certainly not the first thing I want to try, but when a problem is particularly stressful or unpleasant, I can sometimes find myself working on other things on the side of my desk. It may be listening to and editing a playlist, or maintaining an idle chat with a friend. It could also be changing that load of laundry I threw in earlier as a small break. However I got there, if I’m really stuck, removing these extra things is another important step.
Literally changing your perspective
If I’ve been looking at a piece of code long enough, sometimes I need to change how I’m looking at it to really see it. An easy way to do this is to change the font, or sometimes even just the font size. Even if the content hasn’t changed, rearranging the letters a tiny bit seems to force my brain to process it like it’s something new.
If I’m feeling particularly drained or frustrated with a problem, I have also found it helpful to move to another place for a bit. This is easiest with a laptop, or you may be able to use Remote Desktop from an empty meeting room. In a pinch, I’ve taken a pad of paper to a coffee shop to see what happens and been pleasantly surprised.
Confirm the problem is important
If you are really, really, really stuck on a problem, maybe there is a good reason. It may be beyond your current capability. It may also not be important enough to justify more effort. A quick chat with your manager shouldn’t hurt. If it is dangerous to ask your manager, you may want to find a new manager, but that’s a topic for another post.
Ask for help
If your problem is important enough, and you’ve made an effort and failed to get yourself unstuck, it’s not inappropriate to ask for help. Pair programming is an excellent technique for tackling complicated problems.
Searching or asking online for an answer could also help, but I’ve not personally had much luck here. Your results may vary.