Stop ACTA

How to ask a question like a pro

Posted in CakePHP on 29.03.2009.

A lot of people tend to ask questions like plonkers. Therefore, I give you this guide to help you out in such situations. This guide is related to CakePHP, but it can be applied to virtually everything.

Introduction

I have received many phone calls about computers. Help, my windows is broken! they'd say. And I would say fix it. Then they'd get mad and I'd explain:

You can't just say to your doctor "it hurts" and expect him to know what's causing the pain and how to cure it. Doctors need to examine you, make some tests and you need to provide them with some clues and insights. It's the same with computers. I can't fix computers over the phone nor do I want to. I need to be there, examine the crime scene and when I get some clues I might try to find a solution.

OK, to be honest I never said all this, at least not all of it at once. I just stopped answering the phone, but I think everyone got the message.

Help, my cake tastes awful

I'm sure it does. But that's not enough information for someone to fix it. If you ask a question, you have to know that nobody knows anything about your app. You can't assume people know what the hell are you talking about.

But let's take the doctor analogy a bit further. Normally, when something is wrong with our body, it hurts. This is called a symptom. When something is wrong with your application, it hurts too. Normally, it shoves an exception in your face (this is the main reason why I wear a world war two German helmet when debugging stuff). Exceptions are also symptoms.

Now think about it. Symptom gives us some clue about what's causing the pain. If it's a stomach ache, there is a great chance you have some trouble in you digestive system. But sometimes the cause of your stomach ache is somewhere else (and I have a feeling this happens more often than one might think). It is the same with exceptions. Sometimes, they give us clues which tell us exactly what's the problem. Sometimes we have no idea.

Lesson? Stating your exception is not always enough for someone to diagnose your problem. Did you notice the bold word here? To fix something, you need to diagnose it. To diagnose something, you need to be familiar with it.

Doctors are - or at least they should be - very familiar with our bodies. People who answer cake related questions are - or at least they should be - very familiar with CakePHP. Still, doctors and bakers don't know and can't know all the answers at once. They need more.

This is where you need to play your part properly.

"Relax, I be a doctor"

First you have to make sure you didn't make an appointment for a silly issue. Here are some steps to make sure of this when facing a problem with CakePHP:

  1. Read the error message carefully. If it says you have a file missing, you probably have a missing file. You would not believe how many people have asked questions which were already answered in their error message.
  2. No error message? Check your log files. They are located in ~/app/tmp/logs and are very, very informative. A lot of people don't read them and come asking for stupid stuff.
  3. Read Cookbook and API about the functions and classes you're using. Do you have a parameter missing? Are they all in a correct order and of correct type? Double check it!
  4. Use the search Luke! Although this website is apparently the best (right after the best page in the universe), there are plenty of other Cake-related websites and blogs out there. I'm fairly positive Google has a lot of them indexed. All you have to do is type the correct search phrase and off you go: a load of answers, tips, tricks and sometimes even complete tutorials and plugin solutions (the last one is the best, I swear).

These four steps can be compressed into one simple principle.

If you're new to CakePHP, there is a great chance your question has already been answered.

The end is nigh

Now we come to the point of actually asking the question.

Let's get back to the doctor analogy. This is the point where you talk to your doctor. You explain the error you're getting. You talk about what you want to achieve. If possible, show the code immediately. When explaining your issue, be precise and detailed. But not too detailed. Only give information which is relevant in solving the problem. People don't have time for "once upon a time" stories.

There is only one thing different here than the doctor situation. In both scenarios, you are the one in need of help. But unlike the doctor, people answering your questions are volunteers. Which means you have to be patient and polite. Yes, sometimes they mess it up, and sometimes it's the other way round. This doesn't give you the right to be demanding (or bakers to be condescending).

The end

In a nutshell: do your best to avoid asking the question. But if you really, really have to, remember that communities are based on good communication. It starts with a good question.

Remember, if you disagree, you're a plonker.

Article comments — View · Add


No comments!