7

The edit in question: https://stackoverflow.com/review/suggested-edits/11482386

I did some thorough research on the etiquette for editing answers, and the most authoritative answer I've found (When should I make edits to code?) seems to suggest that my edit was a quality, valuable edit. But of the three reviewers who reviewed my edit, they all chose to reject with the canned "It should have been written as a comment or an answer" reason.

These two things seem to contradict one another, so was my edit not a valuable one, or what? And if not, what was wrong with it that is not addressed by the meta question I referred to?

1
  • 3
    Please don’t let this incidence discourage you. Even if this edit was (apparently correctly?) rejected, your edit was actually really good: you made a concise change that could well have corrected an error in the answer, and you explained your change well in the edit summary. This is in fact one of the better edits I’ve seen. Commented Mar 3, 2016 at 13:15

4 Answers 4

68

It's actually NOT obvious that your change is correct - at least, not without further changes.

You corrected the argument to getString() to be a proper XPath expression... However, a cursory scan of the documentation indicates that the default logic used to evaluate these expressions is not XPath! It's merely... XPath-like. If you want to actually use XPath, you have to set a non-default expression engine first, which isn't currently being done in the answer or question.

Now, I might be waaaay off on this - I'm not terribly familiar with XMLConfiguration. But if this is enough to throw me for a loop, it's probably gonna look sketchy to most reviewers as well, even those conscientious enough to try and verify your change before approving. Given there were no reports of this syntax not working, I'm skeptical your change is actually necessary... or even helpful.

5
  • 31
    You're completely right - I must have subconsciously made the assumption that they were using the XPath expression engine without verifying, because that was my use case. This edit is in fact wrong, or at least wrongly presumptive! Thanks for giving me clarity!
    – SPoage
    Commented Mar 2, 2016 at 21:04
  • 20
    I should mention here that adding an alternate answer which described the use of an XPath expression engine would probably be appreciated. While it doesn't appear to have been necessary for the asker at the time, it may be that it would benefit others in the future.
    – Shog9
    Commented Mar 2, 2016 at 23:53
  • 1
    I had the same feeling, so I left a comment on the answer noting the difference for anybody who might make the same mistake I did. I think that's probably sufficient.
    – SPoage
    Commented Mar 3, 2016 at 0:43
  • How does the edit comment "This edit was intended to address the author of the post and makes no sense as an edit. It should have been written as a comment or an answer." make any sense considering Shog's answer?
    – cat
    Commented Mar 3, 2016 at 16:16
  • 1
    Look at the comment SPoage did leave, @tac. It helps clarify a potential point of confusion in the answer without making assumptions. The rejection reason isn't a perfect fit here, but comes reasonably close to "check your assumptions with the author first", which I'd guess was the intent here.
    – Shog9
    Commented Mar 3, 2016 at 16:23
12

The author clearly meant to use square brackets seeing as he explicitly stated they should be used.

Also, you edited the example ("foo.getString("[@bar]")") without editing the description to match ("you just access it with the square bracket + @ notation").

5

I see the problem.

Because the actual edit was only to a couple of characters you had to make what were apparently pointless edits elsewhere in the answer to reach the 6 character minimum change. This might have thrown off one or two of the reviewers - it certainly threw me off when I first looked at your edit.

On balance, if you only need to make a one or two character edit to fix a post then it might be better if you do just post it as a comment - at least until you get to 2k rep when you can make such minor edits to your heart's content.

It's a difficult call - on another day your edit might have been accepted - so all I can say is keep suggesting edits but also keep answering to get to the point where you don't need to be peer reviewed.

4
  • 1
    That was my initial inclination as well - I didn't want to have to make the additional pointless edit, but I figured that most people would get the point based on the edit comment. In the future, I will probably opt to use comments instead, as you suggest. That would also prevent the additional scenario that popped up, which was that my edit was actually based on a large, faulty assumption. Thanks!
    – SPoage
    Commented Mar 2, 2016 at 21:06
  • 2
    Which edit are you saying was "pointless"? The one where he corrected the capitalization of XML? I hardly think that's pointless. If he hadn't made that edit, one would have grounds to say that he failed to fix everything that was wrong with the post. I certainly would not have approved an edit like that without clicking "Improve." Maybe I'm a stickler for grammar.
    – Cody Gray Mod
    Commented Mar 3, 2016 at 10:18
  • 1
    @CodyGray - OK - I should have said "apparently pointless".
    – ChrisF Mod
    Commented Mar 3, 2016 at 10:26
  • You are overlooking that this edit was incomplete because it did not alter the text "you just access it with the square bracket + @ notation", which btw is also a red flag that this goes against the intent of the original author. Commented Mar 5, 2016 at 8:02
2

As a general rule, if the edit materially alters the content of the post, it should be rejected. With code, an edit, even one that only changes a couple characters, is presumed to be a material modification. Exceptions would be correcting obvious spelling errors or removing unnecessary white space- though I generally will skip edits of this nature if I'm not familiar with the language.

When editing explanatory text, there is generally a bit more wiggle room. Some users are overly-verbose in their explanations, and it can sometimes be possible to remove whole sentences without removing any actual content of the post. These edits are good, because they make the overall post easier to read and extract meaning from. Other times, content can be added or removed based in discussion that occurs in the comments, but which has not otherwise been applied to the post in question. I usually approve these edits as well, though it helps when the editor makes a comment explainin where they came up with the change.

To summarize, if the edit makes no material modification to the post content, or if it was clearly sanctioned by the original author by way of comments, it gets approved. Otherwise, it gets rejected and the editor is advised to write a comment instead.

4
  • Fixing bugs in sample code in answers, even if it does, yes, change the answer, is acceptable. Encouraged, even. But the fix has to be verifiable for the review process. Commented Mar 5, 2016 at 8:16
  • 2
    @NathanTuggy It's difficult to know for sure whether something is really a bug when you aren't using the writer's environment. Better to leave it alone and add a comment.
    – Warren Dew
    Commented Mar 5, 2016 at 8:29
  • @WarrenDew: For answers? I don't know what you mean. Answers can't possibly rely on quirks in the writer's environment; if they do, they're terrible. Commented Mar 5, 2016 at 18:45
  • Agree with @NathanTuggy - 9 times out of 10, something that looks like a mistake in code is actually intentional, and the edit would do more harm than good.
    – theMayer
    Commented Mar 6, 2016 at 14:31

You must log in to answer this question.

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