Debugging with a drill

We’ve got this great old lamp that blew up recently. Smoke, black charred bits, scary. Easy enough to fix right? NO! The Master Craftsman that originally put this together must’ve been able to bend space & time. Wire doesn’t normally bend at right angles unassisted, much less an acute angle like this:

lamp-pre.jpg

But the person that wired this up back in the 1960s did it. Twice even.

I spent a couple of days trying to make it happen. Different gauge wire, wire lube (such a thing exists!), hacks with hooks, pulling, pushing, whatever. Other than sore thumbs, nothing.

So could applying some practical real-world software engineering experience help? When facing a code problem, the first tool out of the bag is usually the log statement. (Logging helps you get a better grasp on how a particular piece of code works by exposing the inner workings. Very low-tech, very hacky.)

In my case, I dragged out the power drill and starting adding log statements to my lamp assembly. Luckily I just needed one:

lamp-post.jpg

That little black hole at the junction there was all it took. Under real lighting I was able to see how it all came together. Once again, props to the original builder, pretty clever. Sure it’s unsightly but like most code bases, that’s life. Anyway the light works now and everything is hidden by the lampshade.

lamp-on.jpg
This entry was posted in Uncategorized and tagged . Bookmark the permalink. Both comments and trackbacks are currently closed.