10

Consider a situation where the OP had a certain problem and error, and his post receives few valid answers. However, none of those answers worked for the OP, so even though each one of them was helpful to some degree, he ends up discarding the whole code and rewrite it from scratch.

I am not sure if the OP can post an answer to the original question, because the OP didn't effectively solve it; he bypassed it in a fresh attempt at the problem, and a statement like I rewrote the code and it didn't occur again doesn't help anyone in the future.

In such a case, should any of the answers be accepted and if so, what should be the criteria for deciding that for the OP? Also, is it possible that there be some version of answer that OP posts that can help future visitor?

4
  • 1
    I'm less worried about the acceptance of existing answers and more worried that the OP has invalidated existing answers.
    – Makoto
    Commented Apr 26, 2015 at 9:45
  • 4
    Consider the following scenario: OP has some problem and took a very bad root in order to solve it (usually it happens if he is inexperienced programmer) and encountered into some syntax error. Then comes a bit more experienced user and solves the syntax error while leaving the OP on the wrong path. Then comes an experienced user and completely rewrites the solution with a memory efficient, fast and syntactically correct solution. Which solution should the OP accept? This is a classic situation when the "accepted answer" logic is wrong in most cases. Commented Apr 26, 2015 at 9:46
  • 2
    Distilling useful Q+A out of a "I tried to solve this problem the completely wrong way" comment from the OP is rather a stretch. All you can do is leave a comment that encourages the OP to post the solution that he ended up using. That might happen, probably not right away. It is otherwise a valid answer. Commented Apr 26, 2015 at 9:58
  • "the OP didn't effectively solve it" -- absent an example, it's hard to comment precisely. But assuming the original question was clear about the broader problem at hand (which would make it an above-average question), that the solution wound up being a completely different approach than they were originally struggling with doesn't mean they didn't solve their problem. Even if they weren't clear, as long as they edit the question to improve it so it is clear, a rewrite of the code still is in fact a reasonable answer to the question. Commented Apr 27, 2015 at 8:10

1 Answer 1

11

In my opinion, the OP should not only say that he solved the problem a different way, but should also show what he or she did. That way, the original problem is still archived (so others with a similar problem can see what didn't work), and the solution/workaround/rewrite is also there to show what did work.

This is similar to this question

1
  • 10
    "but should also show what he or she did" -- and to be clear: do so by adding a new answer to their own question, and even accepting it if appropriate. If that answer winds up getting upvoted as useful/helpful by others (assuming it actually is), so much the better to help others find it more easily. Commented Apr 27, 2015 at 8:05

You must log in to answer this question.

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