0

Two of my edits had been rejected for unfathomable reasons. The question Django user profile The answer Django user profile

My first edit:

https://stackoverflow.com/posts/6092091/revisions

My second edit (submitted with a more detailed description of why it is necessary, kindly suggested to me in my question here Why was my suggested edit rejected?)

https://stackoverflow.com/review/suggested-edits/2844451

Links to Django docs supporting my edit:

https://docs.djangoproject.com/en/dev/ref/models/fields/#onetoonefield https://docs.djangoproject.com/en/dev/topics/auth/customizing/#extending-the-existing-user-model

  • code edits are commonly rejected. That's nothing new. Code edits like this always appear too radical. – John Dvorak Sep 23 '13 at 16:01
  • 4
    don't use suggested edits to fix errors in an answer related to its meaning or the code. Use them for formatting, spelling, and the like. Use comments (if you can) to point out errors or add an answer of your own that is correct. – Kate Gregory Sep 23 '13 at 16:02
  • @JanDvorak it seems they are rejected by people who don't actually understand the code, otherwise they'd approve. How is SO going to help people if we are discouraged from improving the code quality? – Dmitry Sep 23 '13 at 16:02
  • 3
    If the code quality could be part of the problem the question was asked to resolve, it is not helping the OP to correct it for them. In general, editing code blocks (for a reason other than indentation) is heavily discouraged. – BlackVegetable Sep 23 '13 at 16:04
  • @BlackVegetable so I should instead post another answer with almost identical code? – Dmitry Sep 23 '13 at 16:05
  • 1
    @DmitryKharlamov Yes, that is often the correct solution. You could, of course, change the content of that piece of the code and use ... before and afterward to make it clear that the remainder is identical. – BlackVegetable Sep 23 '13 at 16:06
  • @BlackVegetable thank you, that's what I ended up doing and I feel much better now. – Dmitry Sep 23 '13 at 16:14
2

In general, edits involving changes to the code should be done by the original poster of the code, not by other editors. This is especially true of questions, where changing the code may actually invalidate the question, and it's doubly true when the edit merely involves a coding style preference.

The preferred way of dealing with substandard code is to leave a comment, explaining why the code should be changed. This is supported by the reasons that the reviewers gave for rejecting the edit. One of them said it was a radical change, the other one suggested that you were trying to reply to another user (suggesting that a comment would have been better).

If a comment fails to get the poster's attention, then you do what you did, which is to provide a detailed explanation of why the edit should be made. But ultimately, you'll get better results for edits like this when you earn enough rep to just perform the edits yourself, without needing review approvals (suggested edits are held to a stricter standard, because they consume community time for the review process).

  • thank you for a detailed explanation. I wish this was made clear to me before my edits, it'd save a lot of time for many people. – Dmitry Sep 23 '13 at 16:13
  • I would say even if >2K this would be an inappropriate edit, just an edit the editor got away with – Richard Tingle Sep 23 '13 at 16:13
  • @RichardTingle: I have, from time to time, made a code edit when I was 100% sure I was correct, but rarely. You seldom know for sure what the original author intended. – user102937 Sep 23 '13 at 16:15
  • @Robert this question doesn't concern editing question code, where the side effect is breaking the original question. The question concerns editing answer code, which is still a rather hot topic from what I've seen – Shoe Sep 23 '13 at 16:52
  • @Shoe: The answer is meant to be general enough to cover several scenarios, not just the one the OP is asking about. – user102937 Sep 23 '13 at 16:54
2

You shouldn't be using suggested edits to change code to your preferred "style". You may prefer using that method over the one the author used, but as they are the author of the post they can use whichever method they prefer of accomplishing the goal. If you wish, that is something that you can comment about.

Editing a post to make superficial changes just to make code in line with your personal preferences is simply not productive, and just results in edit wars.

  • I appreciate your view and general view on code edits which was not known to me. Only thing I want to make clear: this is not just preferred by me. This is suggested by the docs, and improves the usability of the code. If I had a different view, I'd post it in a separate answer, I considered this edit to be too small for its own answer and I considered the original answer perfect. – Dmitry Sep 23 '13 at 16:12
  • @DmitryKharlamov Which is why I said it should be a comment, not it's own answer. It doesn't matter if both you and the docs think that it's preferred. An author is allowed to use a solution that's not preferred. There are certain practices that are considered "best practices" by languages that I've worked with that I strongly disagree with. If someone went around adding them to my answers I'd be quite pissed, as I have a right to use my own preferred practices. – Servy Sep 23 '13 at 16:33

You must log in to answer this question.

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