5

In this question: An elegant way to get a boolean to represent 1 and -1, I have a specific question, and I post some code which gives it context. This answer answers the question correctly.

However, this answer is actually a better solution for code context.

Should the checkmark go to the first answer, regardless?

3 Answers 3

12

The check should go on the answer that you think is best.

Exactly answering the question doesn't automatically make the answer the best one. And in fact, I would agree with you that the currently-checked answer is not as good as the other two; voters clearly disagree, but the choice isn't theirs to make, or even mine. It is yours.

2

Thank you for this question. I was just about to ask it in order to get a second opinion on this topic.

I was thinking about the similar case, where the OP asked a very specific question, in which he gave an example of his code and what he is having trouble to get working. The question was answered by two members. One offered a solution to the exact problem being addressed and the other one explained a possible redesign which, if done, would make a question for OP obsolete. The specific question asked was however not case-specific, and could find application in various domains.

The OP said that the redesign suggestion was helpful and that he applied it, but that he still accepts the first answer because it gives an answer to the question. And this is where I tend to disagree with Matthew. In my opinion that was the only correct course of action, since only the first answer offered is a solution to the very specific problem being posted.

Why?

In case another person is searching solution to that very specific problem it will this way get quicker to the most useful answer. In case the OP marked the second answer (redisign) as the right one (since he most probably benefited more from it), the person searching for the solution would end up reading some very asker's-case-related redesigning suggestion first, before finding the exact solution in the next answer.

IMHO, the right answer is not necessarily the "helped-me-the-most-answer", since we should also keep in mind the community component. The answer, providing the solution to the question should be marked as an answer. The OP should not behave "selfishly" and decide what helped him/her the most, but should also give a thought what will help others the most, if they faced the similar problem.

And just to make it clear, I am not saying that those helpful answers should not be written. Oh no, actually we all should be very thankful for those, since they contribute a lot.

I would gladly get further opinions on this topic.

0

I would favor the one that answers the question over the one that provides an alternative, possibly better solution. In these situations the alternative may even get (a whole lot) upvotes and even comments saying "the other answer should have been accepted".

I would upvote the alternatives since they are also correct in that they solve the problem, but I prefer to see answers that actually answer the question, rather than an answer that solves the general problem behind the question.

Maybe someone that has the same problem would come across the question and then read the answers and realize that they probably shouldn't be trying to approach the problem the way they thought, or maybe they'll learn something new and use the alternative, possibly better solution.

For example, I'm looking to do something using regex, and someone presents a solution using a built-in function.

Maybe my regex approach was bad (aesthetically unappealing, error-prone, etc).
Maybe I'm just doing it using regex as an exercise.
Maybe, based on poor design decisions, I've been forced into a situation where I need to use regex and re-designing the entire thing may be unfeasible within the given constraints (eg: deadline in 72 hours)

On the other hand, if the question was presented as an XY problem, then it would likely be more attractive to pick the alternative solution that addresses the actual problem, rather than whatever problem the askers have created for themselves. But then to me that doesn't really answer the question although I'd consider it a bad question in hindsight.

Justifications could be made for either side. I tend to think that while someone may be faced with an XY problem, for someone else it might not be an XY problem, and for some it is for instructional purpose.

You must log in to answer this question.

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