Fixing Cars and Fixing Bugs

Mechanic repairing a car's engine
Photo by cottonbro studio: https://www.pexels.com/photo/a-person-fixing-a-machine-7564871/

Lately I’ve caught myself watching YouTube videos about car repairs. I don’t do car repairs. The last time I changed my oil or rotated my tires was decades ago.

What gives?

I spend my work day supporting a legacy desktop Java application, tracking down subtle bugs hidden in impermeable god objects. Unfortunately, the owner of this software would be most displeased if I were to share the problems and solutions online.

Actually, most businesses have the same attitude. They want to keep their special sauce secret. Consequently, debugging videos are hard to find. I have found some, but the editing on these car repair videos makes them more like watching a mystery show as it unfolds.

One interesting thing I’ve discovered is that the lessoned learned in car repair are often applicable to my world of debugging and software development.

The first lesson is probably the most obvious: a systematic approach to finding the problem will save a lot of time!

When they get a car that’s making that ticking sound, they first check to see where it’s coming from: on top of the engine, underneath, in front…

Then they lean on experience. When have I seen this in the past, and what were the causes? Which would be the quickest and easiest one to check? Let’s try that first.

If the quick and easy checks don’t turn anything up, let’s talk it out with someone before I spend a lot of time on it.  Bring in someone else and see if they have any ideas.

If none of the quick checks work, it’s time to get down and dirty. Digging into the ugly guts of the thing and taking things apart.

This is how I do my work as well. I do my best to reproduce the problem and track down where it’s coming from. I’ll try a few quick things that have worked for me in the past. If those don’t work, I’ll talk to someone else about it. If those ideas don’t get me there, that’s when I start digging through logs and debuggers and profilers and all of the time-consuming work.

Another thing that’s fun: finding the source of the problem. The reactions are very similar, too:

  • “Oh, I can’t believe that! That little thing caused all of this trouble!”
  • “What a stupid design!”
  • “How was this working before?”
  • “Just a little maintenance would have saved all of this hassle!”

Maybe it would be fun to start working on my car again…