Solve hard problems the easy way: with a binary chop 🪓

Solve hard problems the easy way: with a binary chop 🪓

September 08, 2022 | 🕐3 Min Reading Time

We've all been there. You are facing a thing that simply isn't working, but you have zero ideas why. You only know that it needs fixing, and you're feeling like humankind's last hope.

This mysterious busted thing could be any of the following:

  • Some code someone else wrote
  • Some code you wrote...3 months ago (might as well be someone else)
  • Your dryer, hot tub, or anything else bound to go wrong in your home
  • Anything that you have no business fixing but stubbornly refuse to pay someone to do

As an engineer, father, and homeowner, I find myself fixing random things all the time. The non-engineers in my life always ask, "How in the hell did you figure that out?"

Well, I need to be honest with you all: I'm not a wizard and do not possess any magic skills.

Ok, maybe I've got one magic skill. You seem cool, so I'll let you in on the secret...

Into the Unknown...

For years, I've utilized a strategy that has helped me dig into some incredibly thorny problems and stroll through the unknown without fear. It wasn't until a recent re-reading of The Pragmatic Programmer that I found that it had a name: the binary chop.

The Binary Chop.

into the uknown It's simple. Take any situation where something is not working quite right and do your best to find the natural forks in the road of that thing's operation. Finding the spots where the thing could take "Path A" vs. "Path B" enables you to instantly eliminate 50% of the universe of possibilities. As you continue with each iteration, you reduce the problem set by 50% each round. This is how you zero in on a problem, by reducing the landscape considerably with each chop.

Let's imagine we're debugging why a dishwasher isn't working:

The Problem

The dishwasher runs, but at the end, there's a bunch of nasty water sitting in the bottom.

Diagnosing The Problem With a Binary Chop

  1. There's a drain where the water goes. Is the drain clogged in the dishwasher?
    • It is. Clear it. You should be good.
    • It's not. Therefore, the problem is up the chain somewhere.
  2. What's up the chain? It looks like the diswasher drain pipe goes into the garbage disposal.
    • Is that clogged?
    • It is clogged. Clear it. You should be good. You've fixed it!

You can see that in this simple example, we didn't dive right away into tearing apart the mainboard of the dishwasher or replacing a pump that may be faulty. Instead, we started by halving the problem and eliminating possibilities as fast as possible by taking what we know to be true and working our way down the chain.

If it's a broken dishwasher or the most complex piece of software you've ever seen, nine times out of ten, it's just plumbing. It'

Whether moving bits from one function to another or transporting the remnants of last night's dinner, almost any system can be broken down into a chain of traceable steps. It can be easy to be intimidated by a technology that seems like voodoo. But, if you take what you know and break down the possibilities into simple next steps, you'll soon find that things become much less scary.

Walk the Binary Tree

binary tree

By eliminating half of the field of possibilities, you begin to traverse a binary tree with ruthless efficiency. Your brain will reward you by not freaking out at a universe of endless possibilities but instead will be excited by eliminating 50% of all eventualities with each iteration.

Most systems are simple if you slow down and take them a step at a time. If you are freaked out by all the broken morass suddenly laid before your feet, take a breath and start at the beginning.

Remember, it's just plumbing.

In the words of "Adam's Song," from Blink 182: stay calm and trace the cord back to the wall, you may find that it was never plugged in at all.