4

I recently edited an answer: an experienced user told a newbie "Here, let me rewrite your code for you". I say that if you're going to be an exemplar, you might as well be a good exemplar, so I removed all the redundant and unnecessary casts and object accessors from the experienced user's code. (The original code was morally equivalent to print((string)obj.ToString()); print(obj.ToString().ToString());).

I can understand someone that's not familiar with the framework not knowing what was going on, but why would someone mark it as deliberately malicious/destructive?

The edit is here: https://stackoverflow.com/review/suggested-edits/7219355

3
  • 1
    Edits to code in questions is very dicey: you could edit out the problem they are trying to get an answer to, change the meaning, introduce new errors etc. Mar 7, 2015 at 15:02
  • 1
    @Plutonix - in this case it's an edit to an answer.
    – ChrisF Mod
    Mar 7, 2015 at 15:04
  • Yep, I've now clarified that above.
    – piojo
    Mar 7, 2015 at 15:04

1 Answer 1

4

This was a case of three bad reviewers.

When you reject a suggested edit as “spam or vandalism”, it trains the spam filter to think that the IP address or network it originates from is used by spammers. Like a spam or offensive flag, this must not be used lightly, it must be used only in cases where the origin of the edit is clearly unproductive and undesirable. It must never be used in the case of an incorrect edit, any more than a spam flag on an answer that is merely incorrect or unhelpful.

piojo, don't worry about your account: once you reach a few hundred reputation points, the spam filter won't restrict you. This could be a problem for a newer user however.

As to whether the edit should have been rejected at all, it depends whether the edit was correct. I don't have the technical competence to judge. In general, removing an unnecessary cast is a good edit. From the help center:

When should I edit posts?

  • To clarify the meaning of the post (without changing that meaning)
  • To correct minor mistakes or add updates as the post ages

Removing casts tends to make code easier to read and maintain, so it is to be encouraged, providing of course that the cast is truly unnecessary. If the cast was necessary, then “clearly conflicts with author's intent” would have been the correct rejection reason (the intent being to post correct code), or “causes harm” with an explanation of why the cast was necessary.

15
  • 1
    Okay, thanks. But it still seems strange that so many marked my answer the same way. I think they must have wanted to say "Incorrect change" (though it wasn't). Does that option not exist, so reviewers will choose "deliberately destructive" instead?
    – piojo
    Mar 7, 2015 at 15:30
  • 2
    Well, using that rejection-edit is not quite as dramatic as SPAM-flagging, though it is wrong. And none of the points cover the edit: 1. It's not a clarification of the post, though (if correct) an improvement of the code. 2. It's not correcting a mistake according to OP, nor an update. Thus, a comment would be the proper course. Mar 7, 2015 at 15:32
  • @piojo Either one chose the spam option and the other two picked the same option rather than bother to think which one was right, or you were unlucky enough among the thousands of suggested edits per day to encounter three reviewers who don't pay any attention to what they're doing. Mar 7, 2015 at 15:34
  • @Deduplicator No, a comment is not the proper course here. A comment is for when you're unsure. Once you're sure whether the modification is warranted, either you edit the post if it is, or you don't edit if it isn't. Please read the help center, I've even helpfully quoted the relevant part in my answer. Mar 7, 2015 at 15:35
  • And I mentioned those two points you quoted. Neither actually gives licence to do that edit. Mar 7, 2015 at 15:37
  • 1
    It's starting to sound like this type of correction is just impractical. I'm too obsessive to feel like it should be allowed to give bad code to newbies (specifically, to give a rewrite containing new problems), but a comment would not ensure the newbie sees the correction, and another answer would not be appropriate for this change.
    – piojo
    Mar 7, 2015 at 15:39
  • @Deduplicator You could call it a mistake. In game development, it's a sin to add unnecessary computation, unless there is some benefit.
    – piojo
    Mar 7, 2015 at 15:40
  • @piojo: For what it's worth, I sympathize: I'm for using the most clear, concise and efficient code always. Mar 7, 2015 at 15:43
  • @Deduplicator: You could also say it was a clarification, because when a relatively new Unity3d dev looks at obj.GetComponent<Transform>(), they might wonder why it doesn't say obj.transform, which is the way it's written >99% of the time.
    – piojo
    Mar 7, 2015 at 15:43
  • So it really wasn't a strong correction or a strong clarification, but a weak instance of both.
    – piojo
    Mar 7, 2015 at 15:44
  • 1
    @Deduplicator: Choosing that rejection reason is as dramatic because it trains the anti-spam system, much like spam flags do, but unlike spam flags, there is no way to dispute a suggested edit rejection reason.
    – BoltClock
    Mar 7, 2015 at 15:45
  • @BoltClock But does the system work anyway, or do the spam filters become too aggressive toward users that make edits? That answer determines whether this is a bigger problem to be addressed.
    – piojo
    Mar 7, 2015 at 15:48
  • @BoltClock: Is there a penalty for the suggester comparable to SPAM-flags? I can't remember ever having heard about one. Maybe I over-emphasized that part in the comment. Mar 7, 2015 at 15:49
  • 1
    @piojo: As mentioned in the answer, this may affect new users or anonymous editors.
    – BoltClock
    Mar 7, 2015 at 15:49
  • 2
    @Deduplicator: Oh, no there isn't such a penalty.
    – BoltClock
    Mar 7, 2015 at 15:50

You must log in to answer this question.

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