Over the years, one of the best pieces of problem solving advice I’ve been able to give my kids is to Talk to the duck. This works so well my 18yo took a rubber duck with him to college.
See if this sounds familiar. You’ve been struggling for hours with a piece of code that just won’t work properly. You finally decide to get some help so you call over a co-worker and start to explain the problem. And then half way through the explanation you realize what the solution is.
There is a decent chance you’ve done this. There’s a decent chance you’ve done this on multiple occasions. Ever wonder why it works? In order to explain what’s going on to someone else you have to lay the problem out logically to them. Start to finish. Out loud. Typically when you are stuck, especially after hours on the same problem, you are skipping around all over the place. A glance at the first half of line 50. Nope. Ok, how about line 37? Nope. The loop that ended on line 72? Still nope, Where is that stupid bug! But when you not only start talking it through bit by bit, explaining each piece of logic as you go. All of a sudden there it is!
So what does that have to do with a duck? Well, simply enough, that process of walking through the problem logically doesn’t have to be done in front of someone. You can stick a rubber duck down in front of you (make sure it can see the screen of course) and start explaining to the duck. As you explain to the duck you’ll go through that same process of logically organizing everything and at least stand a decent chance of seeing your problem.
Warning! If the duck talks back please seek help. From a qualified, real, person. Not another duck.