Hodja on Debugging

Sep 10, 2018   #Naseeruddin Hodja  #Debugging 

I loved Naseeruddin Hodja stories when I was a kid. Heck I love them now too. They give me a good laugh and, as is common with good humour, manage to point at some truth once in a while.

One of these is a story where Hodja is searching for something in the garden. His wife asks him what he’s searching for and he replies he’s searching for his ring. She then asks him about where he’d lost it. He replies saying he’d lost it in the bedroom. Puzzled, she asks him why then is he searching for it in the garden. Hodja replies “because it is brighter here”.1

I guess there is more context to that story than I can recall - perhaps as an allegory referring to an earlier event involving his wife.2

And a lesson it is indeed.

I see this story being played out between random parties on Chennai streets pretty much every day. A wide enough road has cars parked on either side, turning it into a narrow road. Vehicles negotiating these streets come close to brushing each other so often that by sheer probability some real brushing does indeed happen. At which point, the parties curse or yell at each other and move on.

Why do they yell at each other? Because the other person is the easiest cause point they can address their anger at. Rarely does anyone say, “ok sorry dude, damn these folks who’ve turned the road into parking lot.”

Vehicles on Chennai streets also are hard pressed to stick to a straight path and much often meander even on major roads … because pot holes, manhole covers not at level with the road, whatever. So when a motorcycle rider chances upon a deep pit in his path and swerves around it to save his life, there is invariably a car or auto trying to overtake him. Result - you guessed it - yell at each other. Nobody yells at the road or the road makers and the situation is forgotten.

Even on the occasion that someone speeded up on a road, didn’t see a speed breaker because it wasn’t visible and ended up dying, the tendency of Chennai-ites to not highlight the infrastructure error is irrational. This irrationality is reflected in the tendency of people here to look down on folks who have difficulty with using a software as though they were challenged in some way, instead of looking down on the software instead. There is some hope though, as I see this turn around in a few pockets.

Sometimes in the software world, we’re lost for ideas on how to track a bug, especially if it is a heisenbug. You may take some “shots in the dark” to try to find it. However, these aren’t usually “in the dark”. You try these simply because that’s what you can see. Hodja to the rescue.

I like Hodja’s humourous response more than Toyota’s five whys. It urges you to look beyond the immediately visible by poking fun at it. Then it recurses without an arbitrary number like “5”. So I’d like to call this “Hodja’s debugging principle”.

Hodja’s debugging principle: Ask “how do I know where I’m looking is where the bug is?” Do something to find out. Keep asking till you’re satisfied with your finding. Then fix it.


  1. This is also known as the streetlight effect but “Hodja’s principle” rings better :) [return]
  2. For a more comprehensive treatment of the story’s origins, see the quote investigator page on it. [return]