4

For a while now, I have been involved in a comments discussion on an answer that has has hundreds of upvotes. The problem is, it's really a bad answer.

The answer does solve the problem as it is asked, but it is unnecessarily using a technique that may cause problems in the future. Problems would occur if things are added to the standard (in a way they often enough are) or if two people used this technique and their code was to be used together. MDN clearly labels the used technique as a bad practice (unless used in a very specific situation). The thing that probably ticked me off the most was perhaps the big, bold caption: "The right way".

The many users who upvoted this answer clearly must not have realized the problems this solution has. They probably didn't experience the results of this problems yet, and in fact it is quite possible that they never will. However, the code in this answer needlessly puts any user (of the code) at risk of running into the problem with no benefit, save for a slightly "prettier" API.

The kicker is that though the author of the answer has admitted that it is trivial to remove said use of The Bad Technique™, he refuses to do so, on the believe that it really isn't that bad. He also shows a fundamental lack of understanding of the problem, first by stating that his solution works around it (there is a line of code that is related to the problems at hand, but does not in fact solve them) and now by stating he will update the answer if the standard changes (at which point anyone already using his code will be in for a sour treat).

Honestly, this answer is just giving really bad advice. Bad advice upvoted hundreds of times.

Now, what should be done about this situation?


Related question: How to deal with hugely upvoted, bad and outdated answers?

However, that question largely focuses on the outdated part, which is not relevant here. On top of that, it suggests editing, which would probably be nothing but the start of an edit war here, since the author is still active and actively denies the problems with his answer.

9
  • 3
    You can do the same thing you can do for any bad answer ever, downvote and comment (presumably you've already done both). I imagine you already knew that when asking this...
    – Servy
    Commented May 6, 2015 at 14:53
  • 5
    Downvote, explain in a comment, add an alternative answer. That's it. Period.
    – user1228
    Commented May 6, 2015 at 14:54
  • Based on the voting, maybe it's not just the author who is (was) unconvinced. Perhaps the voters are right and it's no big deal.
    – ryanyuyu
    Commented May 6, 2015 at 14:57
  • Highly up-voted means those who up-voted that answer helps them. Commented May 6, 2015 at 14:58
  • 1
    @ShaifulIslam At the moment of voting they are under that impression. The pain of the solution might come later. In fact it is likely that the pain will never come. Nonetheless, the answer needlessly opens that user up to that pain should it ever come.
    – Jasper
    Commented May 6, 2015 at 15:01
  • 1
    @ryanyuyu Maybe. Maybe, the upvoters didn't see the problem. Upvoting doesn't require understanding of the code and the unwanted side-effects it may have in the future.
    – Jasper
    Commented May 6, 2015 at 15:07
  • 3
    @Jasper Well sometimes people are dumb. There's really not much you can do beyond trying to advocate against the bad practice. You can vote, comment, and offer an alternate solution.
    – ryanyuyu
    Commented May 6, 2015 at 15:15
  • If the user is not convinced, maybe you haven't been convincing enough. If you state that 2 + 2 = 4, and then prove it, that's one thing - it makes it a 'good' answer, and any other answer that can be proven false is a 'bad' answer. If you can't prove it, then it's not good or bad, it's subjective, and it's up to the voters to decide. Either prove your correctness/goodness/rightness, or cast your vote and move on.
    – user164226
    Commented Jun 18, 2015 at 14:53
  • @Superstringcheese I think the better comparison would be a statement that π = 3.1. It's good enough for many cases, but using 3.1 without any regard for what you are using π for can get you into problems. Likewise, there's also the similarity that there's a definite improvement to the answer (use 3.14, if only just to make sure people have easier time to follow along if they know of π). And like in the real case, the person using 3.1 can just say "I don't think that 0,04 is ever going to matter"
    – Jasper
    Commented Jun 18, 2015 at 19:24

1 Answer 1

2

I have been involved in a comments discussion on an answer

If your explanation for why this answer can cause problems is being buried due to a large number of comments, include your explanation in your answer. That way, people skimming the list of answers will still see it.

Perhaps you can even convince the author to add a warning/link to the documentation in their own answer, since they acknowledge the issue exists. (Don't get into an edit war over this though.)

You must log in to answer this question.

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