General Problem-Solving Techniques

At its heart, programming is about problem solving. Anton Spraul has put it nicely into words some problem solving technique. I’ve found it very useful to trigger programming mindset. Enjoy!

  1.  Always Have a Plan

This is perhaps the most important rule. You must always have a plan, rather than engaging in directionless activity.

smart mouse

  1.  Restate the Problem

Restating a problem can produce valuable results. In some cases, a problem that looks very difficult may seem easy when stated in a different way or using different terms. Restating a problem is like circling the base of a hill that you must climb; before starting your climb, why not check out the hill from every angle to see whether there’s an easier way up?

restate the problem

  1.  Divide the Problem

Finding a way to divide a problem into steps or phases can make the problem much easier. If you can divide a problem into two pieces, you might think that each piece would be half as difficult to solve as the original whole, but usually, it’s even easier than that.

How to become a hacker

  1.  Start with What You Know

You should try to start with what you already know how to do and work outward from there. Once you have divided the problem up into pieces, for example, go ahead and complete any pieces you already know how to code. Having a working partial solution may spark ideas about the rest of the problem.

I Know What You Did Last Summer

  1.  Reduce the Problem

With this technique, when faced with a problem you are unable to solve, you reduce the scope of the problem, by either adding or removing constraints, to produce a problem that you do know how to solve.


  1.  Look for Analogies

An analogy, for our purposes, is a similarity between a current problem and a problem already solved that can be exploited to help solve the current problem.

look for analogy

  1.  Experiment

Sometimes the best way to make progress is to try things and observe the results. Note that experimentation is not the same as guessing. When you guess, you type some code and hope that it works, having no strong belief that it will. An experiment is a controlled process. You hypothesize what will happen when certain code is executed, try it out, and see whether your hypothesis is correct. From these observations, you gain information that will help you solve the original problem.


  1.  Don’t Get Frustrated

The final technique isn’t so much a technique, but a maxim: Don’t get frustrated. When you are frustrated, you won’t think as clearly, you won’t work as efficiently, and everything will take longer and seem harder. Even worse, frustration tends to feed on itself, so that what begins as mild irritation ends as outright anger.


Think Like a Programmer by Anton Spraul


Tags: , ,

About Ferry T.H.

I'm just your fellow human being.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: