5

I am new to the community and have been active for like four days. I have answered a couple of questions but I realized that sometimes even when my answers are correct, they are being down voted because they are not good practices.

Example One, Example Two

The answers are not technically wrong but more experienced users here find they shouldn't be given. So:

Is Stack Overflow a school or a reference?

I'm not complaining about the votes. I really want to learn so that next time I consider my answers in the correct manner.

6
  • 3
    c++ is an unforgiving tag...And SO is not a school, it wants to be a site with high quality questions and the best answers. Technically an answer could work but the voting indicates either a better answer exists or the solution advocate bad-practice today.
    – rene
    Commented Jul 12, 2014 at 10:05
  • 3
    In both answers, you document the worst possible solution and even tell the OP to not use it. How is that helpful? Commented Jul 12, 2014 at 10:41
  • As rene said, C++ is an unforgiving tag. While composing, know that the best people in the industry are going to read your content. For e.g. this answer of mine got a comment from Pete Becker, so make sure that your posts meet the standards, else downvotes pour in. Commented Jul 12, 2014 at 10:46
  • First question he is asking a abbreviation that i interpreted that he want to use smaller text. In second question I have tried to eliminate the more expensive solution as an alternative to other good answers. Which i believe many people are using goto and try..catch.. to escape from loops. (I have seen many examples, even in popular professional companies products.). Also user was not asking what to use; he wanted merely to learn the possible replacements in C++.
    – ifyalciner
    Commented Jul 12, 2014 at 10:48
  • 1
    Votes indicate the quality of an answer. You say yourself that they are bad practices so evidently votes will reflect this to show that nobody should use them. Commented Jul 12, 2014 at 10:49
  • 1
    On the other hand, sometimes it is useful to warn for bad practices, especially when they're not too obvious and even look smart (which I think is not true here though). I did this once and just for fun asked people to downvote it. Commented Jul 12, 2014 at 10:59

1 Answer 1

11

SO is not a school. It is most definitely a reference and as such, just like any other reference we need to make sure that the best answer is clearly obvious.

To do this, there is the voting mechanism. It allows for a democratic means to float the good answers to the top - those that would add a long term value to the site and others looking for the same question - and lowers those that are not the best approach.

Answers are only as good as questions - which is why there is voting on questions as well. Sometimes the best answer is not the one accepted by the person asking, and voting also helps others visiting the page to get an idea of what is the better response.

As such, when answering questions, make sure that:

  1. You first understand the question (use the comments section under the question to ask for clarifications).
  2. If the original poster is clearly going down the wrong path, then first attempt to fix the error in their approach (for example, edit the code snippet they posted to fix the issue), and then describe your better approach. This is useful to others because it explains why.
  3. Linking to references is okay, but don't put a just a link - this is because links can expire/rot, reducing your answer's merit. So, when referencing a link, copy the relevant parts to your answer.

The point of your answer should be that it stands up against time, it solves the problem, and it is the best approach (the community can decide on this by the voting mechanism).

This does not mean you have to write a book as an answer - in fact, a question that leads to long winded prose answer is a sign of a bad question.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .