2/04/2011

Stack Overflow and how not to suck at using it

What is Stack Overflow?

StackOverflow (abbr. SO) is a top-notch programming Q&A site which is moderated by its own community. In fact I think that it is the programming Q&A site but that might be just me (and about 16 million unique visitor per month).

If you have a programming question then SO is the place to go. It is important to keep in mind that SO is not a forum but a Q&A site. So it is structured in questions and answers to the questions. There are no threads.

As a user one of the most important features on SO of course is the search function. You will search a lot with over 1 million unique questions!

If you want to find something related to Android your search syntax looks like this.
[tag] searchterms

You might have noticed the tag in the square brackets. Questions on SO are to be tagged with an appropriate tag. What is appropriate and not is a matter of common sense. If it is a question about Android for example then the tag would be android plus one or two catchwords like listview for instance. This whole tagging is there to group questions into categories and to make searching easier and more efficient. Every tag forms some sort of sub-site called Tag-wiki which is dedicated to the given tag. Those Tag-wikis are very useful. You have several tabs to display the tagged questions in different ways. You can view the newest questions, featured questions, frequently asked questions, questions by votes, questions with recent activity and unanswered questions.

There are a bunch of other functions on Tag-wikis which are beyond the scope of this article.

Now you know how and where to search for information. It is very important that you really perform an in depth search before posting a question. If you really can't find any information on your problem then you get to the most important part which is where you can screw up badly. We all know that English is not a native language for the entire world neither is it mine but that is no excuse for a bad structured question.

How do I ask a question?

Note that this is a blog dealing with Android stuff (and Unicorns) so the following is a bit Android-centric.

No one is going to yell at you just because you misspelled a word or because the grammar is not correct but people will get pissed off if your question is hard to read and has no structure.

Structure your question roughly with those five points in mind.

  1. A short but descriptive title. For gods sake please don't put the tag in the title. That is if you have an Android question then don't do it like the following example as you have the tags for tagging a question. Every time you do that a kitten will die!
    Android: How can I ...
  2. The description of your situation. Try to make the readers clearly understand what you problem is. You can also post images here or code for example.
  3. Post what you have tried so far and why it did not work.
  4. Post the expected result or what you are trying to accomplish.
  5. The question. In one single phrase and as short but descriptive as possible.



Try to use the markdown editor as it is meant to. It is a very powerful tool! There is even a description of what and how to do to format your question using the markdown syntax. Read it and use it!

This is also a very important point. I have mentioned inserting code. Now there are some DOs and DON'Ts.

DOs
  • Follow the Java™ Coding Style Guide (especially the 80 columns per line rule)
  • Only the most important part of your code
  • Correct your indention. If you use tabs instead of spaces to indent code shame on you
  • Short description of what the code is supposed to do if necessary

DON'Ts
  • Make the code box to scroll horizontally checkout the first DO point
  • Post entire files content. Every time you do that a whale will beach!
  • Post code of two different files into the same code block

Now to post well indented and formatted code you just copy and paste the code into the question at the position you want it to be then you select the entire code and hit the Code Sample button (that's the one with the brackets) or you hit Ctrl + K. That's it your code is now wrapped into a code block and highlighted.

If you keep all that in mind you will definitely get a decent answer soon enough. Another important thing to keep in mind is that you can write comments to your question and answers to your question regardless of your reputation (we will discuss reputation later).

By no means try to answer to someones answer or comment as a new answer or fur is going to grow on your palms.

Now if someone posted an answer to your question or possibly even more than one person then it is your duty to accept the most helpful answer by clicking on the green check mark on the left of the answer. If you have over 15 reputation you may also up-vote that particular question in order to signalize to other readers that this answer really helped you. We will talk about voting in a moment.

If your answer remains unanswered for a period of time you can always add more detail to your question by editing it. Add more information about the code or what other things you have tried and failed in the meantime for example.

If you happen to solve your problem yourself without receiving any helpful answer or no answer at all just post the answer to your question yourself! You are encouraged to do so.

How do I answer questions?

If you read a question and know the answer then take your time and answer the question as detailed as possible. Provide sources if you have found the answer on another site for example. The structure and formatting of your answer is equally important as the structure and formatting of your questions so all the above tips, DOs and DON'Ts apply here too.

Now if someone reading your answer thinks that it is helpful he will probably up-vote your answer which will signalize to other readers that this answer indeed is helpful and not just a meaningless collection of characters. It will also increase your reputation by 10 points on answers and by 5 points on questions. However if you post a wrong or unhelpful answer you will most likely get down-voted which reflects negatively on your reputation. If you get down-voted regularly you are doing it wrong.

You can and are even encouraged to up/down-vote answers and question. Don't just up-vote because someone has x reputation or because his avatar looks good. Vote based on the answers or questions content. If you happen to not have any clue about a certain domain don't vote. Only vote if you really understand the answer or question. Down-voting will decrease your own reputation by 1 point which is supposed to prevent people from just down-voting wildly because the feel like doing it. However if you encounter an answer or question earning a down-vote do it. The reputation is just a number but by down-voting where appropriate you will help the entire community but don't exaggerate!

Stack Overflow has a chat?

Indeed! Stack Overflow offers an amazing web chat which is structured into rooms. Most of the interesting programming areas and languages provide a room. You can enter the rooms and read what others are chatting about with 1 reputation and chat yourself with 20 reputation.

I don't know that much about the other rooms policies but I can tell you that there are a few DON'Ts in the Android chat room you should know about and follow in order to not get me mad at you.

DON'Ts
  • Enter the room and burst out your question without even saying hello! It is disrespectful!
  • Post code in the chat or puppies are going to die!
  • Repeat a question multiple times if you don't get an answer to it immediately. We are not there solely for your question!
  • Start a private chat with someone. There is the private room function for that purpose.
  • Post in any other language than English.
  • Post anything disrespectful, illegal, racist and pornographic.
  • Expect someone to answer your programming questions as it is not meant for that. You have to post a question on Stack Overflow and link to that question if you want to discuss something about it.
  • Neither post a question on Stack Overflow and bug every single person in the room to answer your question. You can post it once and wait for a response. If you receive no response then the above rules of how to post a question apply.
  • Pretend that there are no unicorns! You'd be lying and we all know it!
If you keep the rules above in mind we all are going to have a great time together!

Other stuff I should know about?

There is always more to know. Describing the entire site and its functionality is way beyond the scope of this article. There are other resources you should refer to in order to get more information about SO.

Here is a list of helpful resources:
Read and/or use them. No really do it!

I hope I didn't forget anything uber important. I'm sure I did but I'm not perfect. If you think that all the above is bullshit and that I'm making all that up then please leave a comment. Share your opinion on where my understanding of SO sucks.

Now happy asking and/or answering!

1 comment:

  1. Things happened for a reason so be thankful for everything.
    Thank you for your wonderful article. I hope you could inspire more people.
    Please visit my site.

    triciajoy.com

    www.triciajoy.com

    ReplyDelete