Forums like this one can be a great help to a frustrated programmer. They've helped me out of vexing situations more than once.
However, a lot of people don't know how to ask for help effectively. They post questions, and then wonder why no one ever replies (or, at least, why no one ever replies with anything helpful).
It's important to understand that you're asking other busy programmers to take time out of their schedule to assist you. The easier you make it for people to help you, the more likely you'll be to get that help.
There is such a thing as a stupid question. It's fine to be ignorant; everyone has to start somewhere. It's not fine (or helpful) to be lazy or sloppy when asking other people to volunteer their time to help you.
With this in mind, here are a few simple ways to ask better questions:
- Use a descriptive subject.
Vague subjects make it less likely that people will even look at your message. Here are some examples of bad subject lines:
"why am I getting this message?"
"please help with my problem!"
"what's wrong with this code?"
We already know you have a technical problem; that's what this forum is for, right? Restating the obvious in your subject provides zero information. Instead, summarize your problem concisely, including the key specifics.
Recent examples of good subjects from the forums include:
"xml_parse function not parsing url's from XML properly"
"when ,where,how to use ob_start and ob_end_clean"
"mkdir() on network mounted drive using XP"
This way, people can browse the forums and instantly spot problems with which they might be able to help. Someone who has worked extensively with the xml_parse function, for example, will recognize the first post as one which they can probably resolve easily.
- Provide details...
Posts that look like this will be almost universally ignored:
"Hey guys, I want to build a web-based XYZ in PHP. How can I do this?"
"I'm trying to add a whatchamajigger to a client's site, but I'm having problems. Any suggestions?"
"This code is producing an error. Why?"
None of these provide enough detail to even define the problem, let alone come up with a solution. At the very least, we need to know exactly what error message you're getting, what problem you're having with the whatchamajigger, or what aspect of the XYZ's architecture you're wondering about. Most people don't have the time or the inclination to pry your actual question out of you.
Provide source code, if possible. Provide the exact error message that you're getting. Tell us the details of your environment (PHP version, OS version, etc.), if they seem relevant. Tell us what you've already learned about the problem (you did try to solve it yourself before asking for help, didn't you?), so we can avoid duplicating work that you've already done. All of this makes it easier for people to help, and more likely that you'll get an answer.
- ...but don't flood your audience with irrelevant detail.
Don't dump an entire page of source code into your message. Trim it down to the parts that you're having problems with. No one wants to trace through eighty lines of code that has nothing to do with the actual problem. And no one wants to hear about the background of your project; none of that has any bearing on the technical issues. Too much detail is just as bad as too little.
Distill your problem down to its essence. Tell us exactly which function, construct, or mechanism is misbehaving. Tell us how you expected it to behave, and how it's actually behaving. Include the relevant lines of source code, HTML, and/or SQL. And stop there. Extraneous information distracts from and muddies the problem.
- Take the time to use precise and correct terminology.
Computers are complicated. Developing applications that combine technologies as diverse as PHP, MySQL, HTML, CSS, Javascript, Apache, Linux, XML, and more can get really complicated.
To communicate effectively about these matters, you need to refer to things by names that will be familiar and meaningful to your audience. Attempts to describe a particular object through vague hand-waving is not likely to succeed.
If you don't understand the technologies you're working with well enough to talk about them clearly, chances are you don't know enough to define your problem in the first place - which means that we can't help you anyway.
On the other hand, if you do understand the technologies, taking the time to structure your question clearly quite often helps you find a solution yourself.
- Don't ask us to write your code for you.
Unless you have a bag full of money for us, of course. Most of us are happy to help other programmers, but most of us are too busy to feed you and burp you, too. Do the best you can on your own, and only ask for help when you get stuck on a specific point.
- RTFM.
Many of the questions on the forum could be easily answered with a quick visit to php.net's language reference. Check there first. If you've still no love, then post. This could very well save your own time and that of others.
(This post was largely inspired by "How to Ask Questions the Smart Way", a much longer [but excellent] article.)