12

Historically we've left code only answers on the site. As they fall into the it is an answer bag, although some can be construed as low quality.

There's so many code only answers and people put comments under them asking for some clarification of what the code does and more often than not, they're not edited.

What should we do with these?

Do we delete them? If we do, what are the parameters that we decide to delete on? Upvotes, downvotes, user flags?

As there's the issue that sometimes these answers are helpful.

For example: https://stackoverflow.com/a/57283533/3956566

I'm asking this, as a moderator I can be helpful in deleting posts and am wondering if people would like assistance with this. As moderators are not domain experts in all areas, it's something that would need to be coordinated with the community in an agreement with flags and some type of algorithm to remove poor posts from the site expediently.

19
  • 12
    I'm personally more in favor of voting on wether they are useful or not. A code only answer can be useful or it can't and either way it's very often more useful than no answer so I'm not sure it's beneficial to make absolute rules about it. If it's just crap then we have LQ and if it isn't just crap then what do we gain from deleting it?
    – ivarni
    Jul 31, 2019 at 5:29
  • @ivarni I come across so many of them in my modding duties. Due to flags, comments etc. Some of them have dubious value - others do answer the question. I'm wondering if we do have an onus on keeping the first on the site?
    – user3956566
    Jul 31, 2019 at 5:30
  • 2
    I think people who have a silver, gold tag for one of the tags included in the question may decide (as they know the language well) for the question who has been already answered and a new user gives code only answer. Jul 31, 2019 at 5:31
  • 3
    @YvetteColomb You have a much bigger sample size than me on this, I'm just speaking from the experience of having had code-only answers solve the problem I was googling in the past. I still think a good ol' DV on the dubious ones are better than potentially throwing the baby out with the bathwater. Note though, that these days I'm mainly interacting with main from the perspective of someone trying to solve something and not looking at new, active questions so I might be biased.
    – ivarni
    Jul 31, 2019 at 5:39
  • @ivarni it's not something that can be a default goto - keep or delete - I believe, we need domain experts
    – user3956566
    Jul 31, 2019 at 5:40
  • 6
    The problems I see with just voting is that it costs rep, so low-rep users will be hesitant to do so, and it's irreversible if the user voting doesn't check back. Personally, I'm for deleting through NAA with a comment, because it tells the answerer what's wrong and allows him/her to improve the answer without leaving downvotes from its previous state
    – Erik A
    Jul 31, 2019 at 5:48
  • @ErikA I totally agree - it can cost a lot in rep to downvote them. You can end up losing literally 1000s in rep.
    – user3956566
    Jul 31, 2019 at 5:50
  • So we're going to delete potentially useful content because we're worried people are worried about loosing rep? Isn't this a site for professional and enthusiast programmers? Can't we expect at least some of them to be able to look at working code and figure out why it works?
    – ivarni
    Jul 31, 2019 at 6:12
  • @ivarni no, that's an illogical jump. I'm talking about the stuff that is downvoted, do we keep it here? I'm deliberately distinguishing between the two.
    – user3956566
    Jul 31, 2019 at 6:13
  • 2
    OK, fair enough. But then I don't see why we need to distinguish between code-only downvoted answers and text-only downvoted answers. Or mixed content downvoted answers.
    – ivarni
    Jul 31, 2019 at 6:13
  • @ivarni code only answers specifically have no explanation
    – user3956566
    Jul 31, 2019 at 6:37
  • @YvetteColomb I guess my point is that an answer isn't automatically unuseful just because it has code with no explanation. If it's indicated as being unuseful based on DVs then that metric is just as relevant for every other answer. If you're spesifically talking about downvoted answers with only code (as you specified in a comment but never mentioned in the question) I don't see why the same argument isn't applicable to other downvoted answers.
    – ivarni
    Jul 31, 2019 at 6:47
  • 1
    I'm not sure what's this link an example of... An "helpful answer" as the previous sentence leads me to think? There is probably a typo here. (could also be that I completely missed something, it happens often to me...)
    – Kaiido
    Jul 31, 2019 at 7:01
  • 2
    I personally hate answers that have code with no explanation for what was wrong or what the solution is. I despise the ones that just change something in OP's code and leave it to the reader to find what the differences are. However, I still don't want these deleted - I recognise the value in them. Still, my biggest concern are that sometimes people come in and post some code that's wrong. It might not deal with OP's problem (instead tackling another perceived one) or occasionally are not even related to OP's question. Simply downvoting those seems too light.
    – VLAZ
    Jul 31, 2019 at 7:04
  • 1
    With this scope it's hard. Because as mods you deals with tag you don't know. On my little scale, working on fewer tag, either I see the quality => comment asking for clarification, or I pass. Keeping my downvote only for the thing I can identify as bad. I noticed that they trend to multiply on poor question, many people rush the simple question. During the "ruck", people dive in for upvote. Metrics will be hard for those common case, in the emulation a lot of people miss click the upvote button. Jul 31, 2019 at 7:49

3 Answers 3

16

I still feel iffy about flat out deleting all code only answers. Some contain good working code, and by deleting it, we're losing content. If someone who recognizes it as good could edit it to explain why, we'd be able to preserve good content.

We'd also need to pay attention that "code only" won't be applied to answers that have everything in a code block, but the code is well commented and explained from within the code block.

However those are edge cases in my (anecdotal) experience. So how about the following metric to see if we burn the answer with fire, or let it stew in hopes that someone seeing that it's a good answer decides to add commentary:

If the code only answer is flagged and has accumulated 2 downvotes and no upvotes, it can be deleted no questions asked.

If the code only answer is flagged and has a cumulative score of -3 or less, it can be deleted as well.

4
  • 1
    Yep I think we need some type of metric. Thanks for this
    – user3956566
    Jul 31, 2019 at 7:26
  • We could just delete any answer with a cumulative score of -3 or less and nobody would realize it. Why concentrating on code only answers? Jul 31, 2019 at 21:02
  • 2
    @Trilaion A proposal was given a while ago to add a roomba rule for less than -6 scored answers, and their arguments are the same I would give as to why that's not a good idea.
    – Davy M
    Jul 31, 2019 at 21:46
  • 1
    I agree with the note about comments in code. I know I've done that a few times.
    – zero298
    Aug 1, 2019 at 20:45
15

Unless they're redundant, I'd like you, in your capacity as a moderator, to just leave them be. We, the community, can handle them.

A code-only answer doesn't generally do harm simply by existing. They're almost universally not great answers, but they're frequently more helpful than not having an answer at all. And as long as they're there, they may provide a starting point that somebody can edit into shape, or use as a basis for an answer of their own with more exposition.

Also - as much as it goes against my nature to say this as somebody whose instinct is always to write extended prose - in some cases the value of any extra exposition in addition to a code sample is pretty much zero, and there's no real harm done by skipping it.

We, the community, can discriminate based upon such an answer's technical merits and decide whether to downvote, delete-vote, or edit it, or indeed whether to embrace it as it is if it truly needs no prose to make it a good answer. Any of those things might be warranted in particular cases, but a blanket approach isn't. So defer to us on those judgement calls; we can handle them just fine with the powers we have.

The only case where mod deletions are sometimes warranted are when there are lots of code-only answers on a popular question that already has a better answer with explanation, and where the code-only answers add nothing to the better answer that's already present. These are particularly irritating because - for reasons I don't really understand - even the most obviously awful answers on the sort of super-popular 50-answer questions I'm thinking of often attract a few upvotes and end up with positive score. If you encounter that scenario, and you are able to confidently judge that the code-only answers are truly redundant and add no value to the question they're on, then by all means clean them up. But at the opposite extreme, where a code-only answer is the only one present on some little question with 500 views? Not a problem. Let it be.

1
  • 1
    Popular questions attracting poor quality answers should be protected.
    – Raedwald
    Aug 1, 2019 at 8:27
4

As a user and reviewer on Main, concerned about the site quality, I can sympathize with this question...

One type of code-only that could be deleted IMO is what is sometimes posted (esp. by newbies) to an already answered (usually older) question that pretty much repeats something in another answer. It adds no value whatsoever.

Along similar lines, if two answers give the same solution, but one is code only ("Try this" is often an accompaniment so that it's not "code only") and the other has a good explanation, then the one with the explanation should remain.

One problem to consider, however, is that the code-only contribution may have been posted first and has been marked as the answer, already. The "correct" solution would probably be to edit the explanation into the marked answer. This is frowned upon (although can be done without having to go through review by 2K+ users) and is to a certain extent not fair to the person putting in the extra effort.

Before implementing this, however, it should be considered that flagging/deleting such contributions would be a change in policy. Currently, anything that attempts to answer should not be flagged. I've had flags for this kind of thing declined. That's no fun for us or for the moderators...

In any case, this would mean more work for moderators as they'd need to delve into the entire Q&A thread in more detail than some apparently care to do. (I've seen numerous comments from moderators that they tend to view only the comment, without the surrounding context.) There's also the question of having enough knowledge of that particular technology to be able to judge the value of code-only.

A more accurate judgement could probably be made by silver-/gold-badge holders. But then the UI would need to be supplemented for these people at least being able to flag specifically for this kind of thing.

3
  • yep the mod queue can be touch and go. Honestly sometimes it depends on how on top of it we are, to how much time we have to investigate things. If we encourage people to make these flags we do need to honour them. Yes tag badge owners are optimal, but more difficult to implement, as it's a network controlled feature, but you never know they may look at this and think it's worth implementing at some point.
    – user3956566
    Jul 31, 2019 at 10:28
  • Is it 10K? I was thinking it was only 2K. Jul 31, 2019 at 19:49
  • @Don'tPanic I think you're right... :-) Jul 31, 2019 at 20:57

You must log in to answer this question.