Zen and the Art of Problem Solving


Okay, so I picked that title because it sounded good. If you're looking to become one with your problem, I can't help you out right now. What I can help with, is giving you some tips on problem solving. Or rather, how to solve a problem without the solving of the problem becoming the problem. Still with me?

So here you are, you're building some sites, looking for hosting, or maybe just trying to figure out how the hell you're going to get your cats to stop chewing on the computer. Every now and then, a problem crops up. Now, what is a problem anyway? If you want to get poetic; a problem is an occurrence during the performing of a task, when performing the task becomes temporarily impossible.

For example, you're building a site and your power goes out. That's a problem right there. Or, you just built a site, and for some reason a thumbnail won't show, even though the image is uploaded and you've quadruple-checked your HTML. It's a show stopper right there.

How do you solve a problem? There's a lot of answers to that one, and most answers vary with the people who are faced with a problem. But, I'm here to give you some nifty advice on how to tackle most problems, ranging from small to the insanely huge.

The first step in solving a problem is to actually admit you have a problem. Strange as it may sound, a lot of people will plain out refuse to admit to themselves that they have a problem. They blame it on Murphy, or maybe the strange radiation emanating from their neighbors' microwave.

After you've acknowledged the fact you have a problem, forget the problem. I can see you wondering whether I'm high, but I'm not. Once you know you have a problem, go do something else for a while. Watch TV, read a book, kick some ass on your PS2. Sleep. Sleep works wonders if you ask me.

After you've chilled for a while, sit down and prepare for your next step. The next step would be "dissecting" the problem. What that boils down to is that a problem is actually an effect. Every effect has a cause. Find the cause, and you've solved your problem. Now how does one get to the cause? The best way to determine the cause for any given problem is to reduce it to something simple. Let's take an example of a problem I had the other day: I was writing a CGI script that was supposed to redirect a user to a random URL, picked from a list of 10 URL's. What it did was send people to the same URL over and over, so I had a problem.

Now, how do I reduce that to something simple? Right now, all I know is that the problem is there. You start tracing it from the top down - it's supposed to redirect at random, but it's not. What can affect that function of the script? So, you look at the things that could possibly cause your problem. I ended up with these:

1) The list of URL's only has 1 URL in it.
2) The random function actually isn't random.
3) The list of URL's has 10 identical URL's in it.
4) The script thinks there is only 1 URL in the list.

And there you go. There are 4 possible causes for your problem. The next thing to do is to go down the list and mark off the things that are definitely not it. I checked the URL list, and it had 10 different URL's in it. So that gets rid of cause 1 and 3. Leaves me with cause 2 and 4. Next, I checked the random function. Since it's using PERL's internal random function, it definitely _is_ random. Leaves me with cause #4. A few minutes later, my problem was solved.

This approach is what I like to call the "acknowledge, identify, check" process. First acknowledge the problem, then (after getting some 'off time') you identify the possible causes for a problem. Then you check every cause, until you have eliminated all but one. The one that's left, is where you will find the solution to your problem.

Apply this to hosting for example. You are looking for a new host, and you've selected 3 good ones that all offer the services you need. However, you have a problem since you can't decide what hosting provider to use. Identify the causes: I end up with:

1) There is a price difference.
2) There is a customer service difference.
3) There is a service difference. Determine your needs, and you've just checked your cause and solved your problem.

That is just my identification, mind you. So, the price difference - do I really care about a $100 difference? In my case, I don't - so I'll throw that one off the list. As long as I get the services I need. Ah-ha! But I do, otherwise I wouldn't have ended up with these 3 providers. So we toss cause #3 as well. Leaves us with a customer service difference.

Here is where the kicker is; now you have to 'check' that cause. What do you expect from customer service? Are you content with just a contact e-mail and an office hours phone #? Or do you want the full 24/7 guaranteed 2 hour turnaround contract? Determine your needs there, and you've just checked your cause and solved your problem.

All in all this is not the definitive guide to 'how to solve all my problems and make me filthy rich doing it'. It's just a pointer into structured and logical thinking, something that most experienced webmasters, programmers and other people have learned to do. For a lot of newbie to the grand world of adult Webmastering, problem solving might not always be something they've learned, or considered learning. No fear however, it's really easy :D