27

I was looking over a question asking why they were getting "dead code" errors.

Someone posted an answer that basically said the typical "you're unconditionally returning in the loop, so the loop will only run once". While that was true, it didn't actually answer the question. There were multiple issues with the OP's code, and that happened to just be one of them. It was also an otherwise bad, poorly explained answer, so I downvoted it.

Then someone else posted a much better answer that basically completely rewrote the OP's code from scratch with explanation, but still didn't explain the main point that the OP was asking about.

I'm at a loss of what I should do. I don't want to just sit there and judge and downvote every good intentioned answer that misses the point of the question, but is otherwise helpful. From the OP's perspective, they were helpful since they supplied working code and an explanation. From the site's perspective though, someone looking for explanations as to why they're getting dead code warnings isn't going to find such a Q&A helpful.

To what extent should answers that are correct but miss the point of the question be tolerated/encouraged/discouraged?

23
  • 7
    If it doesn't answer the question, then it's not an answer to the question. It should be deleted since it isn't useful for the people asking the same question.
    – Braiam
    Commented Nov 1, 2018 at 22:49
  • 19
    @Braiam Answers aren't deleted because you think they're not useful. Answers are downvoted for being not useful.
    – Servy
    Commented Nov 2, 2018 at 13:58
  • 3
    @Servy Answers that doesn't answer the question, should be deleted. That doesn't preclude that they are useful or not for the reader. People looking for answers to their question, reading an answer that doesn't answer the question, isn't useful either. It doesn't answer the question && it isn't useful = deletion.
    – Braiam
    Commented Nov 2, 2018 at 14:00
  • 18
    @Braiam "I don't think this answers the question" isn't a deletion reason. It not being an attempt to answer the question is a deletion reason. It being spam is a deletion reason. It being abusive is a deletion reason. You not thinking it's good enough is not a deletion reason. Downvotes literally exist for you to indicate that you don't think the answer has succeeded in answering the question. Deletion if for things that are not even to a point where they can be evaluated as answering the question or not.
    – Servy
    Commented Nov 2, 2018 at 14:03
  • 5
    @Servy "Answers that do not fundamentally answer the question may be removed" I recommend you to reread the help center.
    – Braiam
    Commented Nov 2, 2018 at 14:05
  • 16
    @Braiam And if you then continue to read on from there, it gives examples of precisely what that means. This question is not describing answers that are commentary on other answers, asking a different question, saying thanks, etc. It's describing attempts to answer the question that you just don't think are good enough to actually answer it.
    – Servy
    Commented Nov 2, 2018 at 14:07
  • 1
    @Servy where the list says it is definitive or exclusive? It gives examples of common reasons for deletion. The main reason is spelled out in the first line: do not fundamentally answer the question.
    – Braiam
    Commented Nov 2, 2018 at 15:14
  • 7
    @Braiam So you think they just forgot to mention, "or you think the answer is wrong" from the list? This has been gone over in enormous detail in meta, and been made very explicit what "not fundamentally an answer" actually means, and this is not an example of it. Someone posting an answer that you think is wrong, or incomplete, or otherwise a failed attempt at answering the question, doesn't mean a post isn't fundamentally answering the question.
    – Servy
    Commented Nov 2, 2018 at 15:22
  • 2
    @Braiam The fact that it's giving examples doesn't mean you just ignore the examples entirely and pretend they aren't there. The point is to give examples of the types of things that aren't answers. And the types of things that aren't answers are clearly shown as things that don't even resemble an attempt to answer the question, not an attempt to answer the question that you don't think is good enough. The examples still mean something, even if it's an exhaustive list, and can't just be ignored entirely.
    – Servy
    Commented Nov 2, 2018 at 15:25
  • 1
    @Braiam You are continuing to ignore context, and to say that just because one statement used a word and another statement used the same word that they must be entirely identical and no amount of other things said around them could possibly matter. That's not how things work. This question is describing someone answering the question, but in a way that the reader thinks is wrong, and that is a failed attempt at answering the question. The help center is describing posts that are not trying to answer the question, and that cannot even be evaluated for correctness.
    – Servy
    Commented Nov 2, 2018 at 16:01
  • 1
    It's definitely not flaggable, but I'd say such an answer would be fair game for delete votes, should it find itself at a negative score.
    – user4639281
    Commented Nov 2, 2018 at 16:02
  • 3
    @Braiam You may wish that "an attempt to answer the question that I think is incorrect" is "fundamentally not an answer to the question", but it's been said, over and over again, that that's not actually true, and that the policy for what's not an answer is something that's *not even an attempt to answer the question.
    – Servy
    Commented Nov 2, 2018 at 16:02
  • 1
    @Braiam to be fair, it is unclear whether you were talking about deletion via delete votes, or flags. Though I doubt servy would agree with me on this regardless.
    – user4639281
    Commented Nov 2, 2018 at 18:15
  • 1
    @Braiam to be fair, imprecision with regards to discussing moderation has proven to be a bad idea because it leads to confusion of all those involved. Say I agreed that they need to be deleted, but nothing says how they should be deleted, and I upvote your comment, then those reading your comment with all the upvotes will assume that "anything goes" if they don't already know better, and start flagging such answers for deletion, which would be plain wrong. You see, being precise with the language we use to discuss moderation is very important.
    – user4639281
    Commented Nov 2, 2018 at 18:20
  • 1
    Possible duplicate of What comment should I add to code-only answers?
    – gnat
    Commented Nov 4, 2018 at 10:04

4 Answers 4

30

I run into this often on simple-looking Java questions in which the OP has made several key mistakes which all play into one another.

I usually downvote and comment (shock! horror!) when I see those kinds of incomplete answers. I do so in this narrow context since it's pretty clear what's going on and why they're getting downvoted; they're not entirely correct and it doesn't make sense to just let them think that they've got this solved.

This manifests itself as a symptom of FGITW (fastest gun in the West), and the best way to deal with it is to leave your own, complete answer after you've informed the other quick guns that they've left some significant holes in their logic.

2
  • Reminds me of this question where the upvoted & accepted answer has As to why your code doesn't work, I'm not completely sure.. Clearly, answers which solve a problem rather than explaining the issue can be useful.
    – jpp
    Commented Nov 2, 2018 at 11:02
  • 4
    Oof definitely we've got this problem in Java. We also tend to attract answers that just fix the code and don't offer any explanation, and that just kills me. Back when we used to show accepted answer stats for a user I'd get hassled for not accepting an answer and would have to explain "well yes, you solved my problem but I wanted to know why." Commented Nov 2, 2018 at 16:02
14

Back up a step.

If there are entire answers that just fix tangential problems in the asker's code without addressing the question that was asked, then there's something significantly wrong with the question to begin with. Trivially, it's a problem that the code has errors that are tangential to the one being asked about. More profoundly, it's a problem that the code is long enough to contain several such errors. Askers are supposed to provide minimal code examples; we have a closure reason for those that don't:

Questions seeking debugging help ("why isn't this code working?") must include the desired behavior, a specific problem or error and the shortest code necessary to reproduce it in the question itself. Questions without a clear problem statement are not useful to other readers. See: How to create a Minimal, Complete, and Verifiable example.

(emphasis mine).

If we reframe the primary problem as being with the question, the remedy for this sort of situation becomes clearer: either fix the question by editing, or nuke it. (The latter can be helped along, depending upon your rep level, with your downvotes, close flags/votes, and delete votes.)

When editing, some guidelines I'd suggest following:

  • Try to reduce the code to the minimal form needed for the question to make sense
  • If there's also waffly prose, try to tighten that up, too
  • Don't leave existing answers invalidated, but don't be afraid to invalidate existing comments-posted-as-answers. If somebody has posted a load of irrelevant commentary about the asker's variable name typos as an "answer", you're not obligated to keep those typos around in the question forever. That answer should just be downvoted and deleted.
  • ... but do leave a comment on such answers explaining what you've done, as a courtesy
  • If some existing answers both address the core question being asked and irrelevant errors in the code, fix the errors in the question and eliminate the references to them from the answers (explaining why in your edit summary)
  • If some existing answers include modified versions of the entire code block the asker posted, apply your tidying-up edits to both the code in the question and the code in every answer. Take particular care here to preserve the meaning of the answer and not to introduce errors into any party's code.

Ideally answerers would tidy up wall-of-code questions before answering them and we'd never find ourselves having to do these kinds of sweeping cleanups. But since they don't, it falls to us to polish the posts we end up with as best we can.

10
  • While you're quite right that this is a symptom of an unclear question, that doesn't mean that answers posted to an unclear question, and not actually answering it as a result, are not in fact problematic answers. Answers don't become immune to criticism or negative feedback just because the question is bad. I'd argue the opposite is merited. Additionally, if a question is unclear, and people are posting low quality answers to it as a result, that's not an argument for refusing to edit the question to clarify what it's asking on the grounds that it would invalidate answers.
    – Servy
    Commented Nov 2, 2018 at 13:57
  • You shouldn't edit an appropriate, clear question, into a different question, certainly, but refusing to clarify what an unclear question is asking just because someone tried to answer it is not productive at all. The key point here is that you shouldn't edit a question to ask something different than what it originally asked, but you should edit a question to make it clearer to readers what it has been asking all along.
    – Servy
    Commented Nov 2, 2018 at 13:57
  • 2
    TL;dr: bad questions generate bad answers.
    – Braiam
    Commented Nov 2, 2018 at 14:01
  • 2
    @Servy You seem to violently agreeing with me. The thesis of my third bullet point, at least as I intended it, is more or less the same as the thesis of the two comments you just posted.
    – Mark Amery
    Commented Nov 2, 2018 at 14:11
  • 1
    I tried to remove unrelated problems from a question once; it didn't go well. I was asked to stop changing the OP's question by another user. A lot of people here actually want to fix every tiny problem in the code that was posted, as if SO were CodeReview. That said, I personally completely agree with your answer.
    – Aran-Fey
    Commented Nov 2, 2018 at 15:17
  • 2
    @Aran-Fey please, ignore such users. Questions are supposed to be focused into a single issue to solve. If there are irrelevant details to the questions that doesn't change the potential answers to the main problem, they should be cut out, like everything that isn't relevant to the question, like salutation, etc.
    – Braiam
    Commented Nov 2, 2018 at 15:36
  • You can have a tacit but valid question with several different and multifaceted problems contained in it. Case in point. OP has several issues with their code yet the code is minimal enough to reproduce them all.
    – Makoto
    Commented Nov 2, 2018 at 16:16
  • @Makoto That question seems ripe for "no MCVE" or "unclear" closure to me, and I would CV it if I came across it any way other than from Meta. The only question being asked in the body (about why guesses isn't being returned) is totally unrelated to the one in the title, there's a whole bunch of code and prose to wade through to understand what's going on, and there are a slew of unrelated problems of which many are just silly logic errors. It's never going to be useful to anyone other than the question asker.
    – Mark Amery
    Commented Nov 2, 2018 at 17:46
  • @MarkAmery: I can see your rationale as a basis of not liking the question. I don't see anywhere in that rationale that makes this question unanswerable or otherwise off-topic. But I suppose that's a matter for another day.
    – Makoto
    Commented Nov 2, 2018 at 21:04
  • 1
    I agree with this assessment. If the question fails to convey the intention, it needs to be edited. Commented Nov 3, 2018 at 10:39
1

This is Stack Overflow. If you see a question worth answering, and none of the answers are as good as the answer you could give, write an answer yourself! If yours is the better answer, it will be upvoted to the top.

Ironically, this answer is a very meta answer, because I applied this philosophy to answering this question. I didn't like any of the other answers, because they didn't state what I thought was an obvious thing that should be stated. So in giving my answer, I applied my answer at the same time.

5
  • So, users should be forced to read all the answers to know which answers are the relevant, right? Wrong. Users should read answers to know which is the best, not which is relevant to the question asked.
    – Braiam
    Commented Nov 4, 2018 at 17:27
  • I don't see a problem here. People downvote bad answers, and upvote good answers. If the other answers are bad, downvote them. If they're partially good, leave them. If they're good, upvote them. Isn't this all just how SO is supposed to work? Commented Nov 4, 2018 at 19:06
  • 1
    Nope, read the help center, specifically what constitutes a good answer. stackoverflow.com/help/how-to-answer It all of SO was only voting, then the other tools at our disposal, which purpose serve? Voting is for ranking, moderation tools is for, well, moderating content.
    – Braiam
    Commented Nov 4, 2018 at 19:12
  • I'll just leave this quote from the link you provided as my final bit of this discussion: "Any answer that gets the asker going in the right direction is helpful, but do try to mention any limitations, assumptions or simplifications in your answer. Brevity is acceptable, but fuller explanations are better." The OP said that the answers got the asker going in the right direction. I'm recommending taking the time to write a fuller explanation. Commented Nov 4, 2018 at 19:23
  • ... so, you cherry picked a single element of the entire document to push your point of view? That's called confirmation bias. All answers need to follow the entire document of the help center, including but not limited to how to write a good answer and how to write an answer that wouldn't be deleted. My complete response would be copy-n-pasting the entire help center, because all of it should be followed, not only the parts that are convenient.
    – Braiam
    Commented Nov 4, 2018 at 21:16
-18

The issue highlighted by the OP is an inevitable product of human discourse. The real issue is caused by platforms such as Stack Overflow and Reddit etc, that seek to gamify elements of normal interaction to increase engagement - the consequence of which is an increase in intolerance and conflict.

If you don't think someone has answered the question, ignore them - they've possibly provided useful content for someone else.

Upvotes/downvotes and all their clones are just click counters - they mean nothing and have no useful purpose beyond satisfying the basest reward mechanisms that exist within humans to increase the amount of traffic that comes to a site.

3
  • The gamification of Stack Overflow is one of the core properties. It's how we encourage good behavior and discourage bad behavior. It's how we rank good content higher than bad content. It's basically required for the system to work, otherwise it would just be another useless forum.
    – user4639281
    Commented Nov 3, 2018 at 17:38
  • 2
    I can honestly say that I've never paid any attention whatsoever to a contributors reputation and/or the click counter next to an answer. I usually arrive at SO via a Google search and have often found the answer that I want in comments that were slightly off-topic or threads that were locked for various reasons. SO is an excellent knowledge resource - not having click counters would certainly not render it "another useless forum". Commented Nov 3, 2018 at 18:52
  • 2
    I have a feeling that you're being hyperbolic. I arrive at questions on Stack Overflow via google multiple times every day, I rarely ever find what I'm looking for in a comment. Most of the time, it will be in one of the higher voted answers, but depending on the technology and how old the question is, I may sort by activity instead of votes in order to find more recent solutions. Regardless, if an answer has a negative score, I know there's a pretty good chance that it does not contain the information that I'm looking for. If an answer has a positive score, there is a much better chance.
    – user4639281
    Commented Nov 3, 2018 at 19:04

You must log in to answer this question.

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