mcclellangg.com

Plan Like A Programmer_01

Dec 18, 2024

Given that we face a variety of problems daily, it makes sense to have a personal problem solving plan to address them. Most of us generally don’t make a conscious effort to create one. To solidify my problem-solving approach—and inspire others to create their own—I’ve formalized my plan in writing and shared it here.

My own plan is heavily inspired by Think Like a Programmer, but includes problem solving techniques that could be useful to anyone. I encourage you to repurpose and adapt them to your own plan and problems!

“Let’s look at constructing a sample master plan. The ingredients include all the problem-solving techniques we have developed, plus our analysis of our strengths and weaknesses.” — V. Anton Spraul, Think Like a Programmer

This will be the first post of a two part series. Problem solving techniques are essential to any worthy master plan, here I will be reviewing some of my favorites from Think Like a Programmer along with a few I have discovered based on my own experiences.

Techniques

1. Stay calm and avoid frustration

This should be a prerequisite before attempting to solve any problem. Anger and frustration are poor facilitators for good decision making. Take a moment to pause before you start. Check in with yourself.

I’ve found that simple breath techniques or short meditations can clear my mind and help me recenter. I highly recommend you find or create your own rituals that work for you.

2. Formally state the problem

The problems I am faced with most of the time are often presented ambiguously. Problems without constraints are overwhelming. Often, identifying the root of the problem is the biggest challenge. By taking something and restating it, we should aim to create one (or more) explicit and testable statements.

2a. Reduce/divide the problem

If the problem is too complex, then break it into smaller manageable chunks. Doing this makes it far easier to make progress toward solving the problem at large, and builds our confidence.

2b. Experiment

Formal statements should be testable and backed by solid evidence that will either support or refute our original statement.

3. Set time limits and checkpoints

This particular technique is one I employ often when having to solve problems on a deadline. I can be particularly stubborn about wanting to find answers on my own and will end up spending more time than I should on something if I’m not careful.

In order to combat this weakness, after formally stating the problem and creating a plan, I also make an estimate for how long it might take me to test/complete my plan. After the allotted time has passed, I reevaluate based on the following:

This is an important technique that helps ensure continual and concrete progress when tackling complex issues.

Advice

Below items are not directly applicable techniques for solving problems. They are however great to keep in mind, and help you stick to your plan.

1. Problem solving is difficult

Pause and put your problem into perspective. You may be tasked with something that is not meant to be easy or even possible for you to solve on your own. Staying calm, and building confidence is just as important as solving the problem.

2. import this

If you aren’t already familiar, check out The Zen of Python. I often reflect on one line in particular, especially when solving problems:

In the face of ambiguity, refuse the temptation to guess.

It’s tempting to take shortcuts and make blind guesses to solve our problems in hopes of a quick solution. In my own experience, these guesses rarely work. They often distract me from making measurable progress and cause me to deviate from my plan. Incorrect guesses can easily lead to confusion and frustration.

3. Take breaks

If your wheels are spinning and you feel yourself getting frustrated, that can be a good indicator that you should take a break. If at all possible, make time to do so. Once you get angry or frustrated, it is far more difficult to make measurable progress. Even pausing for 30 seconds to stand up and take a few deep breaths can prevent you from spiraling into negative thought patterns.

“When action grows unprofitable, gather information; when information grows unprofitable, sleep.” — Ursula K. Le Guin, The Left Hand of Darkness
"My granddaddy always said: 'If you got a problem you can't solve. It helps to get out of your head.' Pie. It's good." — Agent K, Men in Black III

4. Dealing with failure

We aren’t always able to solve everything on our own. Admitting this is difficult, but when getting to this stage, keep in mind you can still add value to the problem-solving process by clearly expressing what you think the problem is, and asking for explicit help or information.

What's next?

As mentioned before this is the first of a two part series. I'm a visual learner and find visual aids (particularly physical copies) to be invaluable. I'm working on creating a problem solving flow chart to print out and keep at my desk. Once finished I'll share it here.