64

In low quality posts review queues there are many answers which just contain little code snippets without explanation.

If the code solves the question there should be an auto-comment possibility that explanation is desired. If the code does not solve the question there should be an auto-comment possibility for "why code only answers are bad" and the answer may be deleted.

Edit: This topic specifically suggests an auto comment for code-only answers. The topic of the low quality posts queue in general with a lot of clarification was extensivley talked about here: You're doing it wrong: A plea for sanity in the Low Quality Posts queue

Do you agree?

9
  • 12
    Just downvote answers that are not useful. If you want to leave a comment to explain that code without an explanation is not helpful, go ahead, but such posts do not need to be deleted.
    – Martijn Pieters Mod
    Commented Mar 21, 2017 at 13:06
  • 4
    Possible duplicate of You're doing it wrong: A plea for sanity in the Low Quality Posts queue
    – gnat
    Commented Mar 21, 2017 at 13:38
  • 2
    @MartijnPieters Yes however those posts are often flagged as low quality and they should be handled appropriately.
    – Blackbam
    Commented Mar 21, 2017 at 13:57
  • 3
    @gnat Your duplicate suggestion is a great addition to the question however I asked for some really specific feature in order to improve the handling of low quality posts by commenting instead of deleting and this is why I think the topic should be considered.
    – Blackbam
    Commented Mar 21, 2017 at 14:07
  • 4
    @Blackbam: Moderators generaly decline Low Quality flags on code-only posts.
    – Martijn Pieters Mod
    Commented Mar 21, 2017 at 15:45
  • 2
    And what about code-only answers that explain the approach with inline code comments? Most languages have inline comments, right?
    – MSeifert
    Commented Mar 21, 2017 at 17:02
  • @MSeifert The moderator still has the option to decide. The comment should be formulated in a way such that it only is applied to disatisfactory code only answers.
    – Blackbam
    Commented Mar 21, 2017 at 17:50
  • 5
    @MSeifert I think in-code comments are OK. After all, what we want is that answerers explain what their code does in plain English - it doesn't matter how that explanation is presented as long as it's readable. Commented Mar 24, 2017 at 1:12
  • related: New answer-deletion option: code-only answer
    – gnat
    Commented Jan 15, 2018 at 16:03

3 Answers 3

74

Sometimes you really do not need to explain anything and the code itself is the answer. That said I prefer if an answer actually explains why the code block is the answer. To that I have a auto comment in the form of

While this code snippet may be the solution, including an explanation really helps to improve the quality of your post. Remember that you are answering the question for readers in the future, and those people might not know the reasons for your code suggestion.

source:

While this code snippet may be the solution, [including an explanation](//meta.stackexchange.com/questions/114762/explaining-entirely-‌​code-based-answers) really helps to improve the quality of your post. Remember that you are answering the question for readers in the future, and those people might not know the reasons for your code suggestion.

It would be cool if that was presented as a popup when a user submits a code only answer. I think a popup would be better than a comment as the mechanics to remove that comment when the user does add an explanation would be pretty complex to get right.

6
  • 3
    Yes I like this idea a lot.
    – Blackbam
    Commented Mar 21, 2017 at 13:59
  • 4
    I have something similar: Whilst this code snippet is welcome, and may provide some help, it would be [greatly improved if it included an explanation](//meta.stackexchange.com/q/114762) of *how* and *why* this solves the problem. Remember that you are answering the question for readers in the future, not just the person asking now! Please [edit] your answer to add explanation, and give an indication of what limitations and assumptions apply. Commented Mar 21, 2017 at 15:55
  • 3
    Sometimes this one is more appropriate: This question is looking for an *explanation*, not simply for working code. Your answer provides no insight for the questioner, and may be deleted. Please [edit] to explain what causes the observed symptoms. Commented Mar 21, 2017 at 15:55
  • 3
    I also like the idea of a popup! Sometimes even a very nicely worded auto-comment has caused the code-only answerer to insult me for "attacking" them, which is just unpleasant.
    – Ajean
    Commented Mar 21, 2017 at 15:56
  • 2
    "solve the question" => "solve the problem", or better yet, "be a solution"
    – Cody Gray Mod
    Commented Mar 24, 2017 at 7:55
  • 1
    @CodyGray Great suggestion. I like that and I've updated my auto comment. Commented Mar 24, 2017 at 11:29
9

There is no need to add another option to support this case, especially given the unclear distinction between whether or not the code snippet "solves the question".

To reiterate the guidelines laid out in the linked post: answers that consist of nothing but a code snippet should not be deleted. (But they should be edited, either by the author or by another user.) The auto comments being referred to here are only an option when selecting "Recommend Deletion", so it doesn't makes sense to add a comment that applies to answers that shouldn't be deleted.

If you want to have the ability to insert such an auto comment (without recommending deletion), I recommend installing the Auto Review Comments GreaseMonkey script, and updating the config with an auto comment such as this one:

While this code snippet may solve the problem, it doesn't explain why or how it answers the question. Please [include an explanation for your code](//meta.stackexchange.com/q/114762/269535), as that really helps to improve the quality of your post. Remember that you are answering the question for readers in the future, and those people might not know the reasons for your code suggestion. **Flaggers / reviewers:** [For code-only answers such as this one, downvote, don't delete!](//meta.stackoverflow.com/a/260413/2747593)

3
  • Maybe add the option comment but not delete to SO natively? Maybe add recommend deletion with comment for useless/obviously wrong code obly answers?
    – Blackbam
    Commented Mar 29, 2017 at 17:32
  • They handle link-only answers also in recommend deletion.
    – Blackbam
    Commented Mar 29, 2017 at 17:33
  • 2
    @Blackbam 1. I don't think auto-comment-but-don't-delete is worth the effort to build into SO, especially since user scripts for this already exist, with more functionality than SO could hope to include. 2. Wrong answers, even obviously so, are not eligible for deletion, and should instead be downvoted. 3. You are correct that link-only answers should be deleted, but this is because they introduce an unnecessary dependency on an external site, rendering them useless if the site goes down. Code-only answers have no such dependency. Commented Mar 29, 2017 at 20:23
7

I agree that something has to be done in order to face this problem.

The Low Quality Post review queue has one of the best designs among all the queues. By clicking on Recommend deletion most scenarios that might occur have the correct "bucket" to select:

  • In case of "Not An Answer" scenario, the "Thanks", "commentary", "Me too", "Another question" and "Should be an edit" options are provided
  • Also in case of "Link only answer" we have the corresponding option
  • The "No comment needed" option covers the scenario in which the answer is really low quality in formatting and contents, the spam and the one in which someone else has already selected the option you think is correct and you don't want to append the same comment again

What is missing? Well, of course code only answers!

  • Can we recommend deletion?
    No, we can't. Even if low quality it might be useful for someone looking for a code solution.
  • Does it look ok?
    No, it doesn't! An answer containing code can always be explained. The logic it contains, the functions you used, the reason why it works to solve OP's issue.
  • Can we edit?
    Theoretically yes. But first of all, as far as I know, editing "too much" in the contents of an answer is considered rude, as it would be really easy to conflict with the author's intent. Secondarily (but not too much), the main value of an answer is IMHO the explanation, and it represents the main effort of an answer. It wouldn't be fair.
  • Can we comment?
    Actually we can, and Ctrl + V that well known comment mentioned in the other answers. But there's a drawback: the author of the answer could ping us asking to review the edited answer... but what if we don't know anything about that topic? They could also argue that their answer is ok as it is, or even revenge downvote us.
    And what if they correct the answer without pinging us? Who will ever come back to check that answer?
    Last, but not least: commenting doesn't count as a completed review.
  • Can we skip?
    Yes. And that's what we're going to do for all those posts. And those posts represent at least 60% of the LQP queue.

Not only systematically skipping all those posts is frustrating, but it is definitely inefficient. I see only three alternative options:

  1. Those posts should not be sent to LQP, as they will probably be skipped. So the corresponding flags should be declined.

  2. Commenting those posts should count as a completed review.

  3. A specific "bucket" for this kind of answers has to be created. The meaning of the bucket might be discussed. Some ideas:

    • Three users reviewing an answer as code only could send it to a suspended reputation status. The answer is not deleted, but it wouldn't produce reputation until the post is corrected.
    • The answer is marked as incomplete. Its author will have a permanent notification until the post is either corrected or deleted. Reaching a maximum threshold of incomplete answers could lead to a temporary suspension from answers.
2
  • 3
    "Can we skip? Yes. And that's what we're going to do for all those posts." This just kicks the problem a few minutes down the road for the next reviewer who comes along. Since code-only answers should not be deleted, and since reviewers should not put words into the OP's mouth, the proper action would be to press "Looks OK" (even though it doesn't look OK, it's just not deletable) while also adding a comment and perhaps downvoting. The UI is not optimal. Maybe something along the lines of "Should not be deleted" would be a more precise button name, but that's a mouthful Commented Aug 1, 2020 at 14:32
  • @CertainPerformance I agree with you. I have to say that though the UI is not optimal I consider it the best designed queue. That's why I would like "my favourite queue" to be perfect. The problem resides in the fact that all those alternative actions you suggest don't count as a review action. Commented Aug 1, 2020 at 14:40

You must log in to answer this question.

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