This question came from our site for professional and enthusiast programmers.

It's relative on: how to use a page like this.
–
Filip EkbergDec 22 '08 at 17:11

In the specific example that you used, the system worked exactly the way it was intended to work. Someone posted a question with a bad title and the community edited it to make it better.
–
EBGreenDec 22 '08 at 17:13

And the editor then pointed the user (a newcomer, probably not with English as their native language) at Smart Questions.
–
Jonathan LefflerDec 22 '08 at 17:17

Wouldnt it be better if people just learned how to ask good questions from the start? Making it easy on everyone. I just think it's good for all parties if something like this was available.
–
Filip EkbergDec 22 '08 at 17:17

3

Wouldn't it be better if people just read books and stuff, rather than bothering us with stupid questions? Oh wait, that's why we're here...
–
Shog9♦Dec 22 '08 at 17:24

1

I just don't see how this question will have any bearing on a new non-english speaker posting a question in a week.
–
EBGreenDec 22 '08 at 17:24

@EBGreen, what does this have to do with non-english speakers? It's the presentation of questions that need a change, thats all. Has nothing to do with questions being stupid or not. A question is never stupid, just presented in a stupid way, thats all.
–
Filip EkbergDec 22 '08 at 17:33

1

I think that for the question that you were pointing to, the real problem wasn't that the person didn't know how to ask a question, the real problem was that english wasn't their primary language. I suspect that in their primary language they may have titled it perfectly for all we know.
–
EBGreenDec 22 '08 at 17:35

So to reiterate, if that same poster were to post in a week, do you think the presence of this question would cause them to post a well presented question?
–
EBGreenDec 22 '08 at 17:36

Also I see something of a conflict between the title of this question "How to ask a Smart Question on SO!" and the tag "no-question-too-dumb". Don't you?
–
EBGreenDec 22 '08 at 17:38

You still don't see that a question being "dumb" and bad presented aren't the same thing. No questions should be too "stupid" to ask, you just need to know how to present yourself. I know that after reading bits of that text, couple of years ago, my question-asking has gotten fairly better.
–
Filip EkbergDec 22 '08 at 17:45

I don't see the harm in helping users see how someone like myself, which tries to sit on SO a couple of hours per day answering questions and helping out, wants the question asked. If it makes it easier for us all, where's the harm? Im sorry if the example was bad.
–
Filip EkbergDec 22 '08 at 17:46

16 Answers
16

I generally dislike people who link "How to ask questions the smart way" on Q&A sites and on IRC.

One, it is off-putting to a new user who, upon reading the basic FAQs, finds a 20-page manual on how to ask questions the "proper" way.

Secondly, the main problem with HTAQTSW is it caters and is useful to no one. Why is this? Because the people who could use it most will never read it. The people who ask poorly phrased, un-researched questions just aren't going to take the time to read a treatise on how to ask questions.

The people who do take the time to read it and understand it generally already ask questions of a higher caliber than most of the masses.

A while back Joel talked about "How to ask questions the smart way" on the podcast and I actually agreed with him on this point.

+1 and I look forward to your forthcoming compendium on "How To Answer a Question Properly.
–
Rob AllenJul 1 '09 at 14:48

I agree that it's not good to link this in questions or answers, that's why I mentioned putting it somewhere in the faq, so users who are looking for it can find it and read it. And as this is specifically a Q&A site, I think it's quite on-topic.
–
fretjeJul 1 '09 at 15:40

Writing on technical topics is hard. Any writing, including banging out a "simple" question. There are numerous examples on the sites of just how hard it is. Certainly the world could use a terser guide to doing it well, but these people need some advice.
–
dmckeeMay 19 '10 at 15:36

@Simucal I know this is old, but I stumbled upon this while researching how to ask good questions. I believe that there's a third kind of user (me) who wants very much to ask good questions, but hasn't read that article yet - and because of this link, I can. Just my small opinion.
–
Juan Carlos CotoMar 12 '13 at 6:13

When you type in your title, a whole list of question appears underneath. You are supposed to look at those questions, to see if your question already have been asked.

2. Tell us what the problem is that you are trying to solve.

You got to Stackoverflow, because you ran into some problem and during your efforts to fix that problem you ran into a wall. 90% of the time you ran into a wall, because the way you decided to solve the problem is the wrong way. You end up trying to do something that is hard or impossible, Like "How do I get the name of a variable in Python". Well, you don't. Python variables don't have names. In fact Python doesn't really have variables in the standard sense. You are barking up some sort of incorrect tree.

So tell what the problem is you are trying to solve, give us some context, so we can point you towards the right tree to bark up.

3. Format your code.

There is a button in the editor toolbar saying 10101010. Select your code, and press that button before you save. You also have a preview below your editor. There you can see how your question looks. Make sure it's readable.

Care to look at the Python variable name again? I fixed it up based on your recommendations.
–
Nathan FellmanOct 8 '09 at 15:36

Is formatting your code really necessary? It makes a difference, but it's only convenience. Anyone could click it. Duplicates are more annoying; while missing data is a simply 'unrecoverable'.
–
naxaNov 8 '12 at 23:23

4

@naxa: Yes, it is really necessary. No, it is not only convenience. No you can not "click it".
–
Lennart RegebroNov 9 '12 at 10:05

For SO, I think asking questions the smart way includes describing the problem as clearly as possible with the least amount of waste (keep it short and to the point).

Format your text into paragraphs so it isn't a big chunk of text and use bold and italics to highlight words and phrases that are important to the context. Think of it as pre-highlighting the question. I like to bold key issues in my problem (how do I capture the space key with the TextCompositionManager since I don't want to use the InputManager for this).

public static void Foo()
{
using(new TransactionScope())
{
// how do I participate in this transaction?
}
}

Re-read your question after submitting and change anything you think might be confusing or that doesn't make sense.

And, when someone asks for additional information, don't hesitate to edit your question. Adding additional information in the question will bump it and make it likely that more people will read the question.

The funny thing is, half the time people isolate where they THINK the problem is, post the code asking for help, only to get a bunch of answers that say "your code works, your problem is somewhere else". :-)
–
Kyle CroninJul 1 '09 at 17:40

Atwood: Have you read Eric Raymond's How to Ask Questions? Like this epic, 100,000 word--

Spolsky: Yeah. And that's the thing that he tried to encourage people to use as the answer to all Usenet questions that they don't feel like answering right now. Like, point everybody to How to Ask Questions?

Atwood: Well, this is why I say I think the more sophisticated Stack Overflow users are the ones that actually vote for questions. Maybe we should have some sort of promotional thing or bonus that comes with that because they appreciate how difficult it is to actually ask a good question.

Spolsky: Yeah.

Atwood: And I think a lot of people don't appreciate good questions. The irony of the thing that Eric Raymond wrote is that the type of people that ask bad questions are not going to read this giant "Treatise on how to ask questions." It's this total Catch-22 of a problem -- so who does this document actually serve at that point? It's just masturbation for someone.

Spolsky: Yeah. It's just the way you can be one of these annoying programmers which is like [condescending tone] "I'm not going to answer your question because you did not read this entire document."

Atwood: [laughs] But on Stack Overflow the advantage is that, unlike Usenet, people go in and fix your question. I won't give you my whole diatribe, but I've seen it happen again and again. People come in and help you fix your question, and it feels good. It feels good to help other people, I don't know why. It's really addictive. Even I, having built the system -- and frankly I'm a little bit sick of it at this point just because I'm doing it all day every day -- even I still get totally sucked into it. I'll spend hours, literally, just clicking around Stack Overflow, editing stuff, looking at stuff, learning stuff. The system is incredibly addictive, even to me, so I guess that's fair since we were the target audience. So I guess it would be a failure if that was not true. But I enjoy using the system, for what it's worth.

I see this question more about crafting your question so that you get good answers... Write a bad question and you get no answers or wrong answers, which provides positive feedback to get better at it...
–
Won'tJul 2 '09 at 19:48

Have a clear idea of what question you want to ask. Have a clear idea of what an answer would say.

Search SO to see if it's a duplicate. If so, learn from those answers.

Write a good title, which should convey what you're asking while not being too long.

Write the body clearly. Make it clear what you are asking.

Include all the constraints, and when applicable why they are constraints. Something like "must run on Linux" doesn't need an explanation, but something like "can't use Visual Studio" (on a Windows project) or "can't use open source" will need an explanation. Otherwise half the replies will either ignore the constraint or ask why.

Include a description of the environment. Not everybody runs BeOS, or Windows for that matter. Be as specific as you need to be.

Read the Eric Raymond link (the www.catb.orb one) in the question. It's got an excellent guide to the mindset needed to ask good questions, even if the examples given are all Greek to you.

Tag the question with useful tags. Look at other tags to see. Use commonly used tags (the tag entry line will help there).

Once you've asked, monitor the question. There may well be people who can help a lot provided they get more information.

I've now written up a whole article on how to write a question effectively for Stack Overflow.

The key in my view is to read your question as if you were trying to answer it, and see whether it gives all the information you'd need, in the clearest possible way, showing that you're being considerate to those who are trying to answer. If it passes that test, it's likely to do well IMO.

The people who don't ask questions the "smart way" are the same users who would never read such a document.

The prudent user (most users) would first observe and watch the site for awhile to get the "lay of the land," then get their feet wet by answering a few simple questions... then ask their own questions when they are comfortable with the system.

There is, of course, no harm in writing such a "how to" document. It just won't actually solve any problems, assuming there is one.

Whenever possible, don't just dump all of your code on us and ask us to fix it "even if you give us the error messages." That means we have to compile/view it in a browser to analyze it. Be nice, and try to reproduce the problem with the smallest amount of code possible. I don't care about every single class in your file, or every bit of css style (we only want the relevant stuff). This makes it easier for us, and anyone else viewing your question in the future to understand the problem. :D

Oh, and try to avoid exclamation marks at all costs, and use good grammar and descriptive titles. No one likes the class "plzzz hulp meee" tagged only "programming"

The particular question highlighted was a rather egregious example of 'how not to ask a question'. There was an interesting question on the inside, spoiled by appalling presentation. The original title and original content were both 'non-Smart'. The cleanup needed only a limited amount of work - and a degree of ruthlessness without disrespecting the original questioner's intent.

The material in 'Smart Questions' certainly should be cross-referenced and recommended reading. Some people will have sufficient knowledge and experience not to need to read it (they can ask decent questions without needing the explicit guidelines), but many would benefit from (re-)reading it.

Maybe the main FAQ for SO should include a cross-reference to it? That would be my first choice.

I'd like to point to T-SQL Grouping rows from the MAX length columns in different rows (?) as a good example of how to ask a question about a database. It provided the DDL for table definitions and INSERT statements for test data. As a result, I was able to just pop these scripts into my database system and get right to work answering the question.

I'd also like to know if people here feel there should be a separate question on "How to ask a Smart Question on Database Queries".