Probably 10 times a semester, a student taking one of my courses sends me a mail like this:
Dr. Regehr I have this bug I’ve been working on for a long time, I’ve tried everything, I’m going to miss the deadline…
and then 15 minutes later, I get another email:
Nevermind I figured it out.
Is it a coincidence that students mail me just as they’re about to solve a difficult debugging problem? It is not. Rather, they have previously failed to explain the bug clearly to themselves. By explaining it to me in the email, they explain it to themselves and that is all it takes to figure it out. Seriously, I hardly even need to read this stuff.
Since I can solve so many problems with so little effort, I’m thinking it’s time to scale this up. Perhaps I’ll create a web site “Mail a Professor” where people can ask for advice about their worst debugging problems. Nobody will read the mails, but people will get a nice randomized response saying things like “Your makefile contains a suspicious dependency” or “Please explain step two in more detail, I don’t yet understand what’s going on” or “Have you tried the latest version of Valgrind?”
8 responses to “I Can Solve the World’s Debugging Problems”
uncanny. I’ve had similar experiences with students trying prove things for hw assignments, and the same 15 minutes later message. Probably the exact same reason as well
Er, I think I did this a bunch of times with you. In fact, I still do it sometimes with my co-workers: I walk into their office to ask for some advice and then figure out the answer as I explain the problem to them.
Maybe that should be a trick they teach in beginning programming classes:
When you are totally stuck, write an email to somebody asking for help. Make sure you formulate the problem well (maybe have them read Eric Raymond). Then do not send it for half an hour. The answer should present itself.
A variant of this strategy is sometimes known as “explain it to the bear.” See for example:
Thanks for the comments guys 🙂
Actually, I have a somewhat stranger phenomenon. I was playing an “I Spy” game with my kids, where they have to find something like 3 seahorses and 2 starfish in a photo of different junk. Sometimes they will be stuck for a long time, but as soon as I say “I see it”, often (75-90% of the time) within a few seconds one of them will point it out.
Is this some boosting of concentration, or some larger relaxing based on knowing it can be done, like the 4-minute mile? I almost think the latter.
David I don’t know what’s going on but I do this to myself all the time. I can’t think of something, it’s bothering me for hours, but then as soon as I break down and bring up wikipedia/IMDB/whatever, the answer comes to me while I’m doing the search.
Yep, I call this the “explain it to a total stranger” debug method. The conversation almost invariably goes like this:
“Ok, I take this byte and move it over there.”
“Then, I compare that to this byte . . .”
“Never mind, I figured out what the problem is.”
Works virtually every time.