60

Occasionally I will read a question, determine that I can provide an appropriate answer, and then realize that another user has already provided a different answer that I consider to be "better" for some reason.

A recent example of this was a Unix&Linux SO question about how to perform a specific shell operation. The question had been answered well with a specific command to perform the desired operation.

My solution composed some different commands together to achieve the same result.

Is it helpful to provide my alternate answer in this situation, even though I can recognize that the answer is not as "good" as an already provided (and accepted) one?

This has the positive effect of providing additional information directly related to the question which may be interesting to the OP and future readers.

The only downside I can see may be cluttering the page, however this should be mitigated by upvotes maintaining the best post at the top and cascading to "worse" answers for readers who are interested.

It there any SO etiquette related to this situation? Is it better to leave a well-answered question alone, or to provide alternate answers that do include additional and different information?

10
  • 33
    Alternatives certainly aren't clutter. (Listing pros and cons is most always helpful). Couldn't your more elaborate solution also be a better fit for other specific cases than the general approach? And can your answer explain a few more intermediate steps along the way?
    – mario
    Commented Jul 27, 2014 at 17:44
  • 6
    Alternatives can and should be expressed. You may consider starting a community wiki and taking the 'well-answered' posts into consideration.. meta.stackexchange.com/questions/11740/… Commented Jul 28, 2014 at 5:32
  • 3
    @mario you should turn your comment into an answer.
    – ThomasW
    Commented Jul 28, 2014 at 7:29
  • 8
    Given that the topic is Unix/Linux your 'not as good' answer may provide a different view, a different solution or an alternative for someone with a similar problem. Several times now I have found solutions to similar, but not the same, problems in the alternate answers. As long as it adds to the pool of knowledge and isn't redundant add it.
    – Underverse
    Commented Jul 28, 2014 at 8:09
  • 1
    Related: meta.stackoverflow.com/questions/256171/…
    – Palec
    Commented Jul 28, 2014 at 11:54
  • If you know your answer is qualitatively worse, then of course you should not post it. To use a grammatical construct of which I seem to be overly fond, it's clutter at best, harmful at worst.
    – TylerH
    Commented Jul 28, 2014 at 19:47
  • @TylerH My question is certainly not about providing bad or invalid answers. I suppose it's about recognising that the "canonical best" answer has been provided (the most direct response to the exact question) but that you have a different valid solution which may contain interesting information for people with similar problems. The overwhelming response seems to be that alternatives should be added in addition to "canonical best" answers. Commented Jul 28, 2014 at 20:43
  • @JonSurrell If your answer's methodology differs by a large margin, I suppose it might be worth considering. If it's clearly just a less-efficient way of solving the same problem (which is how I read your post), then my previous stance holds.
    – TylerH
    Commented Jul 28, 2014 at 20:45
  • As an individual, I would appreciate such help, but be prepared for some of the not-so-friendly people on StackOverflow to downvote your answer. Commented Jul 29, 2014 at 0:03
  • You could add a link to the other solution you think is better, to give the readers the possibility to choose for themselves. This way, they can find the solutions best suitable for their specific conditions and they can improve their skills by comparing different answers. It's often subjective, if a certain answer is better, than another, whether technically in general, or for specific use-cases. For instance, some might yield better performance in certain situations, or in certain environments, even if not very portable, but this could be irrelevant for some.
    – fozzybear
    Commented Aug 8 at 7:48

3 Answers 3

109

You should not automatically feel "intimidated" by other answers. As long as your own answer is valid and in itself solid, post it as viable alternative. Another answer may be objectively better, but it almost never hurts to have alternatives. Maybe the "better" answer provides the best solution for the exact question as asked, but your slightly "worse" solution can be more easily adapted to other situations. There are always reasons why something may not apply to a very similar situation, in which an alternative solution can prove useful.

2
  • 2
    I don't feel "intimidated" by a good answer, I guess my question is more about the nature of SO. It feels very clean to think questions and answers come in pairs, a question can have a "right" answer. However the most interesting part of SO is the way dialogs unfold and people share varied knowledge that may diverge from just "answering" the question. This behavior seems to be encouraged. Commented Jul 28, 2014 at 13:13
  • 3
    I've had exactly this happen a few times after Googling for some specific error message. All too often, error messages come up for different reasons and the "best" answer only fixes the specific problem in the question, while the "less good" answers apply to my case as well. I use "best" and "less good" in quotes because they're not necessarily accurate in general. Commented Jul 29, 2014 at 6:09
47

In addition to deceze's excellent answer:

What you can do is mention the better answer in your own answer and show that you provide additional information which makes the total better.

2
  • 27
    +1 For adding an alternative answer when a superior answer already exists. Commented Jul 28, 2014 at 17:14
  • 9
    Lead by example, very nice
    – wnnmaw
    Commented Jul 28, 2014 at 19:20
2

In some cases, yes. Remember that we have two ways for an asker to recognize answers - upvoting and accepting. I myself have been guilty of this (adding a worse answer) so perhaps I'm biased, but I will on occasion see a question asked by someone who is clearly a beginner who gets a technical answer that they certainly don't understand and will not any time soon. It may still be a fantastic answer - I can and do upvote them with regularity.

I will, however, often add my own answer that uses some more basic techniques (only the standard library for example). It may be a longer, slightly uglier and less efficient method of doing it - but its a method that they will (hopefully) understand. I've found that my answer, although less highly upvoted (and for good reason) will often be accepted alongside a comment like "Thanks, this is more my speed". I've even had it happen where an existing, accepted answer will be un-accepted and mine chosen instead (just happened yesterday actually).

If your answer is accurate, and helpful to the asker, then I see no reason why you shouldn't add a "worse" answer. SO is here to create a reference for enthusiast and professional programmers of all skill levels - different skill levels may have different answers.

You must log in to answer this question.

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