How to Blaze a Trail: A Guide for Programmers Who Get Lost

March 17, 2023

Graphic of rocks stacked in the shape of a duck

My first full-time job was teaching wilderness survival to adjudicated youth in the deserts of Utah.

I taught my charges how to solve problems: starting fires with bow and drill; bear-proofing a campsite; and, perhaps most importantly, working as a team.

We hiked a lot.

I led the hikes using a map and compass to get us to our destination. But I also used markers left behind by the trailblazers that came before us.

These markers were stacks or piles of stones, commonly referred to as cairns, colloquially referred to as rock ducks.

Why “rock ducks”?

Because the trailblazer would stack an elongated rock near the top to point in the direction of the trail. This stone looked like the beak of a duck.

When you’re blazing a trail, you want to create rock ducks in obvious locations. This serves two primary purposes:

  • Rock ducks help others find and stay on the trail

  • Rock ducks help you find your way back home

How programmers get lost

It’s in our nature as programmers to get lost in the weeds.

We miss the forest for the trees.

We split hairs.

We bikeshed.

We overengineer everything we touch.

There are (at least) four strategies we can implement when blazing a trail as a programmer:

  • Keep an engineering daybook

  • Make it a habit

  • Keep yourself honest

  • Commenting is coding

Keep an engineering daybook

In The Pragmatic Programmer, authors Dave Thomas and Andy Hunt promote the idea of keeping an engineering daybook, a paper notebook in which you record what you did, what you learned, and sketch ideas. The daybook has three main benefits:

  • It is more reliable than memory.

  • It gives you a place to store ideas that aren’t immediately relevant to the task at hand. That way you can continue to concentrate on what you are doing, knowing that the great idea won’t be forgotten.

  • It acts as a kind of rubber duck! When you stop to write something down, your brain may switch gears, almost as if talking to someone—a great chance to reflect.

Make it a habit

Entries in an engineering daybook are rock ducks. They serve as markers on your intellectual trail. But maybe you tried keeping a journal or diary in the past and hated it. James Clear addresses this situation in Atomic Habits:

Nearly everyone can benefit from getting their thoughts out of their head and onto paper, but most people give up after a few days or avoid it entirely because journaling feels like a chore. The secret is to always stay below the point where it feels like work.

Keep yourself honest

There’s another benefit to keeping a journal: it keeps us honest. In The Black Swan, Nassim Nicholas Taleb addresses our innate fallibility and a solution:

While we have a highly unstable memory, a diary provides indelible facts recorded more or less immediately; it thus allows the fixation of an unrevised perception and enables us to later study events in their own context.

An engineering daybook, or journal, helps us remember what we were thinking when we made a decision.

Commenting is coding

Your code comments are also rock ducks, markers for your collaborators and your future self.

While self-documenting code is the Holy Grail of legibility, there are often things that need to be said that can’t be said in the code itself. And sometimes we need to write comments so we can find our way, as Steve McConnell narrates in Code Complete:

Writing a comment makes you think harder about what your code is doing. If it’s hard to comment, either it’s bad code or you don’t understand it well enough. Either way, you need to spend more time on the code, so the time you spent commenting wasn’t wasted because it pointed you to required work.

How to blaze a trail

Life is a journey.

It’s easy to get lost.

Leave markers so you can find your way back.

And so others can find their way forward.


Profile picture

Want to level up your problem solving skills? I write a bi-weekly newsletter about programming, problem solving and lifelong learning. Join now