JonBlog
Thoughts on website ideas, PHP and other tech topics, plus going car-free
How to use Stack Overflow
Categories: Technical

For readers who are unfamiliar with it, Stack Exchange is a group of discussion boards whose novel approach of peer voting and meritocratic moderation has revitalised the forum as a source of interactive help on the internet. Having learnt how the community works (at Stack Overflow, for programming questions) I’ve a few thoughts on how I think the site can be best used.

Feel free to offer feedback in the comments. Bear in mind that this is, of course, all IMO, and probably also slightly OCD. Lastly, do read the FAQ.

Asking questions

It should be obvious that you should look into your problem first yourself. If you are aware your question doesn’t demonstrate prior research, don’t just say “I’ve googled but I couldn’t find anything”; say instead what you did find, and why it didn’t solve the problem. You don’t have to write an essay here, but do try to show that you’ve made an real effort (if only to save your question from down-vote oblivion).

Make questions self-contained as much as you can. Hyperlink unusual references e.g. uncommon software. It is much better to trim examples down to the smallest case; if you must post large items they are better as a Gist or on a pasteboard, to avoid cluttering the question. Avoid linking to filesharing sites such as Rapidshare, since they are often a pain to download from, and may contain malicious payloads.

In general, don’t ask the same question in multiple places; this comes from standard netiquette about crossposting. Ask it on one site, and if it fails to get an answer after a reasonable period of time, ask it elsewhere; don’t carpet-bomb several forums in succession. In cases where you ask the same question on a different forum, always hyperlink to your previous question(s), so people can check if it is already answered. Say something like “I asked this on the Ubuntu forum (see <link>) but didn’t get a solution” in your question.

If you are asked for clarification in the comments, try to avoid too many, or lengthy, amendments in your own comments. It is much better to edit your question and to add the requested information there; you can then respond to the effect of “Thanks @helpfulperson, I’ve updated my question”. This helps ensure questions remain intelligible to new readers after you’ve stopped participating, and saves the need to read through pages of comments to understand the question. For the same reason, it is usually better to improve a post transparently, rather than appending several “Edit:” postscripts. Previous versions are all recorded, so users specifically wanting to see an old version may do so without you needing to clarify what has been added.

Don’t completely change the substance of your question, since this will be frustrating to people who are in the middle of answering it.

Spelling and phraseology

Never, ever, use the phrase “it doesn’t work”, either in your initial question, or in response to someone’s contribution. Always, without fail, explain what program output you expected, and what you got. If someone provides some help, try to use that as a hint for further research and experimentation, rather than something that can be used verbatim – remember that you’re the only person who knows your exact use-case.

Similarly, the phrase “Technology X doesn’t work” is best avoided; it carries with it the implication that you believe you’re not doing anything wrong, and X has never worked for anyone.

Sentences start with a capital, and finish with a full stop, question mark or exclamation. They are usually grouped into paragraphs of three or four sentences. Don’t use more than one consecutive query or exclamation mark, and don’t overuse the ellipsis dots (…), which are rarely necessary in well-written text. Indent your code/markup with the ‘code’ button, for readability.

Don’t add ‘help please’, ‘urgent’ or beg for answers. Try to ask your question in good time.

Try to use correct English spelling, and observe the correct case of proper nouns and acronyms as much as possible. Equally, native English speakers are encouraged not to fuss over minor spelling mistakes – so long as you appear to made an effort with your question. Avoid chat-style words (u, ur, sry, pls, thx, teh), though common acronyms are generally accepted (imo, afaik, fwiw).

Discussion

Don’t add code in comment boxes unless it’s a small snippet. Where you do, use a pair of backtick characters (`) to render it in a pre-formatted style.

It is preferable to update a question than to add significant details across a comments conversation. Updating the question as it should have been asked saves time for new readers, who won’t then have to wade through a conversation to determine the crux of the question.

If you have a small supplementary question, by all means ask it in the comments, but don’t overdo it. Respect the time of the people who help you: if you have a substantial additional query, consider asking a new one. If you like, ping someone who has helped you before with a link to the related question, since they may well be happy to assist you again.

On the Internet, it is considered poor form to ask for solutions to be sent to you via a channel other than the one you asked the question on. So, if you ask a query on Stack Overflow, you should be willing to revisit the same to view any responses. Similarly, if you receive assistance from someone, don’t ask for their email/Skype/whatever, since it will look like you’re just wanting a free private support channel. (If you really need private or immediate support, then consider hiring a professional from a freelancer website).

Voting and reputation

Downvoting answers on questions you have asked yourself can come across as ingratitude. So, downvote on poor answers to other people’s questions by all means, but be very wary of doing so on your own. Be grateful that someone took the time to help you, even if it wasn’t quite what you were looking for. Downvote on these only in the rarest of situations.

The community really likes it when people contribute, and conversely is not impressed by people who only take help but never give it. Ergo, if you are new, try not to ask for excessive help from one contributor, especially on items that you could research yourself. Chat requests from beginners are fine, but bear in mind that these can be time-consuming.

If you have low reputation points, go easy on people for having a low accept rate. Stack Overflow tries to be a meritocracy – you earn the right to criticise! And, always, do it nicely.

Community

Talk to people who help you, if only to thank them. Don’t just tick a question and believe that exempts you from ordinary politeness – it doesn’t. Similarly, don’t abandon questions – always go back to them, either to encourage more responses, or to say you no longer need the assistance. Discuss solutions in the comments under each answer, as appropriate. However, don’t cut-n-paste responses to all respondents, since this looks like spam (so don’t add “Please can you explain more about that” to every answer – yes, some people do do this!).

If you’ve fixed it, add your solution as an answer, not as a comment or question edit. Adding an answer ensures that the question-answer format remains readable for people who read it in the future. If you received useful help from others, consider accepting an answer even if you solved it mostly yourself – this is good grace.

If you no longer need a response, add a comment. Don’t remove the question text, nor attempt to delete it – this can be extremely frustrating for people in the middle of writing an answer, since it renders their effort wasted. If someone answers the question, consider awarding ticks/points even if it is no longer useful to you; it may still be of use to someone else, and good effort deserves to be rewarded.

If you find that your question would be better asked on a different Stack Exchange site, flag it to the moderator. Do not re-post your question there, and again, don’t try to delete the original.

It is best to sign up with a distinctive username, rather than the default @userxxxxxx, since it is friendlier and less anonymous. A few biographical titbits and contact details are often appreciated too.

Respect

Be careful with accidental discrimination. Don’t assume that your interlocutors are male, unless it is clear from their profile (so, “hi guys” is probably best avoided, since it is not entirely gender non-specific, and salutations are discouraged anyway). Avoid making negative generalisations related to nationality, such as “the poor quality of ten-a-penny freelancers from Elbonia”.

That’s the brain dump for now – phew.

Updates

1 Mar 2013: added in a new paragraph regarding requests for offline interaction.

21 Oct 2021: links & grammar, H/T to Peter Mortensen.

22 Comments to “How to use Stack Overflow”

  1. Thank you for the insight and pointer I’m starting to use Stackoverflow now and you’ve been a great help. I’ll keep in mind the tips and try to be a little tider when posting.
    Thanks again Halfer
    Kind regards
    Chris

  2. Really nice post, and really helpful to new people on SO.

  3. William Cruz says:

    I need smtp to send millions emails

    • Jon says:

      There’s probably a Stack Overflow question in that, but you need to give it a try first.

      Moreover, do you have permission to email those millions of people? If you are just sending spam, please don’t – it costs a lot of money to clean up the mess it makes.

  4. Jeff says:

    You recently downvoted a question I had on stackoverflow and I think it could be done in a better manner Yes I had some typos but in doing so you made it much more likely to remain unanswered. Some communication methods work better for certain users and others for other users but even though your reputation is very high. Altering or down voting any question that does not EXACTLY meet you SPECIFIC criteria is not very conducive to a growing community. If the question exists and can be answered leave it alone it does no harm as it stands. If the (stack overflow, or Stack Overflow, or SO–case in point) routines for entering questions is met then leave it alone. With all the users and people looking for assitance try answering the questions instead of nitpicking the syntax. Everyone knows that iphone and iPhone mean the same thing what is the big deal same goes for ios and IOS.

    • Jon says:

      Hi Jeff. Would you add a link to your question? I’ve had a quick thorough look through my recent edit history, but cannot find the one you are referring to.

      I frequently fix readability issues, but unless it is completely unreadable, it doesn’t sound like something I’d downvote. I’ll happily take a look at it again, if it is still published.

      For what it’s worth, the reason editors are particular about case and formatting is that questions on Stack Overflow are for future readers, and not just for the individual poster. I take the view that Stack Overflow is closer to the Wikipedia model (careful writing about actual problems featuring solid research) than the forum model (slang, text-speak, poor spelling/grammar, gimme-the-codez).

  5. Sandeep says:

    Thanks for the edit (https://stackoverflow.com/questions/45745064/sharepoint-list-to-datagridview-in-vb-net), but was the downvote necessary? Does your edit ensure a response post downvote?

  6. Mitchell Andrew Abbott says:

    Thank you for everything you do, you have helped me so much with your corrections.

    I am grateful for your existence!

  7. Ben McCormick says:

    Point D_1: “Don’t add ‘help please’, ‘urgent’ or beg for answers. Try to ask your question in good time.”

    contradicts your Point C_3: Never, ever, use the phrase “it doesn’t work”, either in your initial question, or in response to someone’s contribution. Always, [[without fail, explain what program output you expected, and what you got.]]…

    And by the way asking for help is not begging!!
    You asked us to be play with these rules on SO but did you beg?

    Also, if this is regarding english-sanity!! Then why non-english people are more acknowledged here?

    Only thing you should try focussing on explaining something in a most efficient way!!

    • Jon says:

      I am happy to try to understand your point Ben. In what way does writing a detailed question necessitate adding “help please” or “urgent”?

      I agree that asking for help is not begging. But explicitly adding “help please” (or its many variants) sounds like begging to me, and to some degree, what words mean is how they are heard.

      I should note, also, that the above are my own guidelines for getting a good reception on Stack Overflow. They are not widely-accepted rules, and some old veterans may well disagree with some of them. They are meant to be helpful, but anyone is free to disregard them completely. They may regret doing so, given that the result may be downvotes and a question ban, but I am not responsible for the behaviour of anyone in the community but myself.

  8. Shahid says:

    I’m not sure you are trying people not to answer on Stackoverflow or what. I’m not on Stackoverflow to lobby for the policy. I am there to help people and to get help. I have answered a question and the one who asked was thankful for that. However you voted the answer as not useful. I am surprised.

    https://stackoverflow.com/questions/51846213/java-gui-dropdown-run-different-code-based-on-dropdown-selection?answertab=active#tab-top

    • Jon says:

      Please don’t get into the habit of guessing who downvoted on that question. You have no idea who voted on that question, since voting is anonymous.

      That question has now been closed and deleted for being too broad. I agree that it is good to help people, but some questions are not a good fit for the Stack Overflow platform, and help is best restricted to comments. It is a judgement call that takes practice, I think.

  9. 1. Opening the FAQ link (second paragraph) redirects to the “tour” page. “/help” may or may not be closer.

    2. “a answer”

  10. Do Quoc Huan says:

    Thanks Halfer for editing my post on StackOverFlow. I was shocked the first time when I saw you edit my question since I’m totally new on this coding world. But after checking your profile and the link leading here, I understand your great work. Keep it up! 🙂

  11. Antonio says:

    This is great content! Thank you! I’ve been using StackOverflow for a couple of years, but intensely now. Sometimes, I’m so deep in the problem, I can’t see any light and the questions come out really badly built.
    Thanks for sharing! Cheers from BR!

  12. mischa sandberg says:

    Hi! You did a fix-up on a stackoverflow post of mine:
    https://stackoverflow.com/posts/44855526/revisions

    Two questions:

    – Is there a style guideline somewhere describing what else (like the hth you removed) is not considered good style? Fast search didn’t show me one.

    – It *looks* like you deleted a line then replaced it with exactly the same text. What did I miss?

    • Jon says:

      The second/easiest question first – it looks like I swapped a [pre] tag with the Markdown equivalent.

      In terms of a style guide, it is kind of fragmented over hundreds of posts on Meta Stack Overflow. I tend to think of the shortened version as “would you put it in documentation for a software product” – if the answer is “no” then leave it out. There is a little wiggle room, and some good-faith scope for honest disagreement, but that guideline is not a bad starting point.

Leave a Reply