31

Recently, I posted an answer to an old question where my main goal was to show that a method that was posted years ago (.index()) is the "best" one using a benchmark. Now, the question already had two answers (1, 2) that included a benchmark and both advocated for the same method (which I didn't fancy). I found their benchmarks lacking because they didn't include index(), even though it was already the fastest method in the Python version they used. Given that the OPs initially advocated for a different method, I felt that re-doing the benchmark by including .index() and editing their answers with it would change the original meaning of the answers, so I went ahead and posted my own answer.

Yesterday, a user was initially skeptical about the accuracy of my answer but after being convinced of it, he pointed out to me that instead of posting my own answer, I should have edited the top answer. Later, he went ahead and edited the new benchmark (that was a big part of my answer) into an older answer (this is the revision before his edit and this is after). After this edit, the first part of my answer became redundant, so I'm not sure what I should do with it.

Anyway, the reasoning he gave for his edit was

I don't know if you've ever edited wikipedia but to me stackoverflow is like that. It should just give the correct answer to my question quickly, it doesn't matter who wrote what.

I agree with this sentiment actually as scrolling all the way down to find important information is not ideal but I'm not sure if such edits follow Stack Overflow guidelines, so I'm kind of conflicted.

Even though I used a specific example, my question is more general. If old answers are missing an important detail/information, how should the missing information be conveyed? Should it be edited into old answers by other users or should it be included in a new answer?


Note that this question is not about modernization edits; it's about editing in important information that the OP had neglected to include in their answer.

8
  • 35
    Stack Overflow is not Wikipedia. The big difference is that you can post your own answer. Edits are supposed to preserve the author's original intent. Beware of convincing yourself existing answers that aren't doing things your way are somehow missing important information. Having to scroll down to a new answer is not a big deal and definitely not a reason to edit an existing answer and change the author's intent. Commented Sep 7, 2023 at 21:18
  • 4
    The reason I contribute to Stack Overflow is because it is an open resource almost like Wikipedia. Commented Sep 7, 2023 at 21:20
  • 18
    @MateenUlhaq: There's a huge difference. If Stack Overflow only allowed a single answer to each question, then it would be like Wikipedia. Commented Sep 7, 2023 at 21:22
  • 1
    The editor argues, "The author's intent was to benchmark the answers, he just missed one," which is reasonable. It seems reasonable to update an existing answer and measure the performance of one more method/curve. (And then update which method was fastest.) The voters voted on the basis that the answer was a comprehensive benchmark. Would they still vote the same with the addition of one more method? Probably. Thus, the edit seems reasonable. However, there's nothing wrong with getting reward for your own hard work by posting a new answer. Editing incurs no reputation rewards, after all. Commented Sep 7, 2023 at 21:33
  • 6
    @PresidentJamesK.Polk Your words should be put in some prominent place so that everyone can see it.
    – Dharman Mod
    Commented Sep 7, 2023 at 21:33
  • @PresidentJamesK.Polk So are you saying the answer to my question is always to post a new answer or are you saying it depends on what missing important information is?
    – cottontail
    Commented Sep 8, 2023 at 1:53
  • 3
    @MateenUlhaq what Stack Overflow and Wikipedia have in common is that they're both community curated and knowledge bases. But after that the comparisons really end. Taking the comparison too far runs the risk of destroying historical information because people start to want to edit existing answers too much. Benchmarks are an interesting subject too. I wouldn't support person B adding benchmark information to the results posted by person A. The circumstances in which the tests were performed will be different. It is only too easy to turn a benchmark into a false statistic.
    – Gimby
    Commented Sep 8, 2023 at 8:57
  • I would add to be careful with this idea. The missing information may be missing because it wasn't available or didn't exist when the answer was written. I've had comments to some of my ten-year-old answers asking why I didn't suggest X, when X was developed after my answer. When looking for questions to answer, I don't usually notice how old the question is, Commented Sep 10, 2023 at 14:19

2 Answers 2

16

In this specific case, the editor argues,

The author's intent was to benchmark the answers, he just missed one.

This seems reasonable. This answer benchmarks the performance of several methods mentioned in other answers. The edit updates an existing answer in order measure the performance of one more method/curve.1

old new
old new

The voters voted on the basis that the answer was a correct and comprehensive benchmark. This helped them pick the fastest method. Would they still vote the same with the addition of one more method? Probably. Thus, the edit seems reasonable.

However, there's nothing wrong with getting reward for your own hard work by posting a new answer. Editing incurs no reputation rewards, after all. Furthermore, it looks like you added additional exposition in your own answer that goes beyond the original benchmark. It may be considered to be outside the "spirit" of the original answer (which was a minimal benchmark) to edit that exposition into the original answer.

In this case, I would say both actions (editing the existing answer within reasonable constraints, or posting a new answer with extra exposition and details) are reasonable.


1 It also accordingly updates the benchmarking code which generated the image, as well as the summary indicating which method was fastest.

6
  • So I take it, you agree with how this particular scenario played out, particularly because my answer has additional information that could be useful, right? However, if it had consisted only of the benchmark (and didn't have the additional stuff), my answer would be duplicate of the older answer after the edit, at which point it shouldn't exist, right? In such cases, is it still correct to edit the older answer? Which would imply that I should have edited instead of posting a new answer?
    – cottontail
    Commented Sep 8, 2023 at 1:58
  • 1
    There's a fuzzy line beyond which a new answer is a near-duplicate of an existing answer (and thus increases fragmentation). If the new answer only benchmarked one more additional curve, and nothing further, I would say that it would be in the community's best interests that it was edited into the existing answer instead. Commented Sep 8, 2023 at 4:39
  • 2
    @cottontail, yes, you did everything fight, because your answer added significant new information (not only a single method into benchmark). But editor also was correct to edit old answer since edit is in spirit of answer. "However, if it had consisted only of the benchmark ..." yes, everythingafter this point is correct.
    – markalex
    Commented Sep 8, 2023 at 5:26
  • 2
    "I would say both actions (editing the existing answer within reasonable constraints, or posting a new answer with extra exposition and details) are reasonable." You mean both actions together (doing one and the other) or you mean one or the other. In this case, the duplication of content by editing it in elsewhere might be seen as too much good or not? Commented Sep 9, 2023 at 13:11
  • I agree with this, especially since the original author of the answer has edited the answer before to change it from numpy.argmin(x) to min(range(len(a)), key=a.__getitem__). Changing it again from min(range(len(a)), key=a.__getitem__) to values.index(min(values)) doesn't alter the intent of the answer more than the author's own previous edit. Commented Sep 10, 2023 at 14:30
  • @DonaldDuck that edit corrected a mistake in the benchmark (where they had used numpy arrays initially instead Python lists), which imo is a bit different from simply not considering an option. Also it was an edit by the OP himself. The latest edit includes a method that the OP could/should have included but didn’t. My question is, are such edits OK? The consensus seems to be that’s OK.
    – cottontail
    Commented Sep 10, 2023 at 18:21
11

I honestly don't understand what happened to that poor question. It states:

I need to be able to return the actual index of the min or max value, not just the value.

It does not state:

I need the most optimal implementation.

Yet somehow, a number of answers there have degenerated into benchmarks. Why? Are Pythonistas that desperate to convince others that their answer is the "right" one?

We don't need benchmark answers on questions that don't ask for them, because as you've already noted, such answers get really stale really quickly.

Therefore, the correct thing to do here is ignore the other answers that have strayed into unnecessary benchmark-itis, and post your own that answers the question as asked. I.e., without a benchmark.

Ideally, someone would also edit the other benchmark-infected answers to debride them of that affliction.

7
  • 2
    Indeed. There is a user who adds benchmark answers to all manner of reference JavaScript questions, despite there being not a whiff of "what's the fastest" to the question. Commented Sep 8, 2023 at 16:12
  • 2
    There was a time (and maybe still is) when you could get votes by adding a "benchmarks of the other answers" answer. It's basically a second-chance to FGITW a question. Commented Sep 8, 2023 at 16:46
  • 1
    Re "Why?", in the case of one answer, the author is using the question as a thinly veiled attempt to plug their own "pet project" on github. That might arguably be OK if the question really was about performance, but (as you point out) it wasn't at all. And the code in their answer is nothing to do with answering the question; it is showing how to run their software!
    – skomisa
    Commented Sep 9, 2023 at 5:26
  • 5
    I don't think the benchmark answers are doing any harm. Even if the question doesn't explicitly ask for the most optimal implementation, it could still be useful to know which one is the most optimal when deciding which one to use. And if you don't care about performance at all, just ignore the benchmark answers and upvote the answer you like best. Commented Sep 10, 2023 at 0:35
  • 1
    @DonaldDuck Even though some may find them interesting in themselves, benchmark answers are just noise when they are not relevant to the question. See Why and how are some answers deleted?: "Answer posts that do not fundamentally answer the question may be removed. " And it's not me adding that emphasis - it's in the Help Center documentation.
    – skomisa
    Commented Sep 10, 2023 at 4:25
  • 4
    @skomisa It does fundamentally answer the question, with the benchmark as a motivation for why the author thinks that's the best solution. For example, in this specific case, the question asks "I need to be able to return the actual index of the min or max value, not just the value", and this answer says to use values.index(min(values)) (which is a perfectly valid answer to the question), with the benchmark as a motivation for why that solution is better if you care about performance. Commented Sep 10, 2023 at 14:23
  • 1
    @DonaldDuck No, that benchmark answer absolutely does not "answer the question", because it is merely parroting a solution provided seven years earlier by someone else with 591 upvotes! All the benchmark answers are copying the work of others. And again, the question was not asking for performance or benchmarks at all. My own view is that all the benchmark answers should be closed as "Not an answer" or "Plagiarized content". Maybe I'm missing something here, but you seem to be defending the indefensible.
    – skomisa
    Commented Sep 11, 2023 at 1:50

You must log in to answer this question.

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