Every once in a while I run into a bug in my program that I just cannot seem to fix. I used to get really upset when this happened, but no longer.
Now I see such situations as opportunities. Because sooner or later the bug will get fixed, but trying to approach it by a frontal assault never works.
So instead, I now opt to walk away — to take a bug vacation. I work on something else instead.
Maybe I’ll work on a little side programming project that I never got around to. Or maybe I’ll finally assemble that bookcase that was sitting in a box in the corner. Or I might even cook a nice meal.
Sure enough, when I return, the bug has usually (and somewhat miraculously) become much easier to fix.