Any seemingly pointless activity which is actually necessary to solve a problem which solves a problem which, several levels of recursion later, solves the real problem you're working on (More explanations in the wiktionary)
Actually, my whole life is just one big yak shaving exercise. Luckily, these subroutines ARE my life and are very rewarding. […] you have to learn when to say no to the temptation of “endless fiddling” but it is through this fiddling that I sometimes find myself in a new place, sometimes slightly before the rest of the pack. If it weren't for this fiddling, I'd be spending my life solving boring problems for boring bosses. –Joi Ito on yak shaving