4

I recently suggested the following edit:

Suggested edit

I did this edit because there is no such constructor and thus the answer is misleading and partly incorrect.

Why was this edit rejected? I know I could also have commented the post and perhaps downvote it, but I thought correcting this mistake would be preferable.

Update

IMHO I didn't change the intention of the post, as the author wanted to tell that the variable has to be initialized.

Because I wanted to add some more information on the issue I also posted an answer where I explained how to initialize and what to generally keep in mind with using greendao.

One reviewer approved my edit. Three rejected it.

17
  • 40
    Wouldn't a better edit have been to add an existing overload, instead of removing code that shows the concept (even if slightly wrong)?
    – Oded StaffMod
    Commented May 7, 2014 at 10:32
  • 47
    Be very reluctant when editing code, especially in accepted answers. Better leave a comment to point out what is wrong/confusing.
    – rene
    Commented May 7, 2014 at 10:43
  • 1
    @Oded I also posted an additional answer where I explained how to initialize, what one has to keep in mind greendao and where to go for further research. I thought this was to much for an edit. But I didn#t want to let wrong code inside of an accepted answer as it will confuse people.
    – AlexS
    Commented May 7, 2014 at 12:19
  • 1
    @rene Why should I leave a comment instead of correcting a mistake, if I know 100% I found a mistake?
    – AlexS
    Commented May 7, 2014 at 13:21
  • 5
    @AlexS: Because (1) the edited answer is not really an improvement, (2) the change is minor, and (3) the answer was already accepted. Those three add up.
    – Roy Dictus
    Commented May 7, 2014 at 13:30
  • 24
    You didn't correct a mistake, you removed the essential part of the answer IMHO. If I'm not familiar with how to initialize a variable with your edit I've no idea. A better edit had been to add a constructor that does exist (as Oded pointed out). And my comment is not only meant for you but also for other visitors of this question.
    – rene
    Commented May 7, 2014 at 13:32
  • 19
    Generally speaking, an edit by anyone but the original author should not change the meaning of the post, even if the original author was flat-out wrong. Commented May 7, 2014 at 21:41
  • 1
    OP of answer here. I knew the constructor may not exist, but IMO it's not the task of the answerer to find a solution to this. I showed where the problem is, but the owner of the question can solve it himself. Commented May 8, 2014 at 8:28
  • 1
    @Manu Are you advocating posting answers with incorrect code? Surely the task of the answerer is exactly to find a solution, otherwise its not really an answer? Or perhaps I'm doing this all wrong Commented May 8, 2014 at 8:30
  • @RichardLeMesurier I'm of course trying to always post correct code, but in this case it was a simple NullPointerException which the asker did not found. Showing him where the root of the problem is will be enough. Commented May 8, 2014 at 8:32
  • 5
    @Manu: Purely as an aside, it would have been better if you could improve your answer after having been pointed out in the comments. As I see, you haven't yet rectified the mistake, but continue arguing in the comments. The answer was accepted, means it solved the Op's problem, but the incorrect code fragment can very easily mislead others and in general is not good. Others editing your code is bad, but you editing your own code is good.
    – Abhitalks
    Commented May 8, 2014 at 8:36
  • 1
    @abhitalks OK, will do :) Commented May 8, 2014 at 8:40
  • @Manu thx for fixing broken code. In all fairness, I believe you should reference AlexS for providing the correct code. Commented May 8, 2014 at 8:58
  • @RichardLeMesurier I took it directly from the documentation, not from AlexS. Commented May 8, 2014 at 9:14
  • 3
    If you're not sure of the arguments or don't want to spend time looking them up, something I've occasionally done something like new DaoSession(/* args */);, if I knew args were necessary
    – Izkata
    Commented May 8, 2014 at 17:03

3 Answers 3

22

Well, the general rule on editing posts on stackoverflow is - do not perform / accept at review changes that change the post in major way. In that formulation, major way is not strictly defined. Here is my argument why removing bad code is major change:

The answer was correct in terms of idea present (to initialize DaoSession), and incorrect in terms of suggested example. After the change it become correct based on the first criteria, and the second one is no longer applicable.

Possible question: what should I do with that kind of answer? Well, my vision is - you have to leave comment about compilation error, provide correct code if you want, and flag the post for moderator attention for the case author will ignore you.

As a moderator reviewing that post, I'd probably send this post to close votes queue, and after the post is in that queue - the other man (I mean, not the author) is eligible to change it. I think the first line of moderation shouldn't do it for the same reasons as the ones I wrote not to perform that kind of change proposal, but, as the post is in general good and was accepted, it can be changed by second-line moderator.

5
  • 1
    Sounds like a lot of overhead for this little issue, thus I disagree with you in this special case (existence of the constructor can be checked easily). In general you are probably right, since the reviewers can't check the correctness of the edit. Thus I accepted your answer.
    – AlexS
    Commented May 7, 2014 at 13:50
  • @AlexS Can you please clarify on your disagreement? I didn't get it. Commented May 7, 2014 at 13:52
  • I thought about it again: you're just right. I thought it would be less overhead to let the reviewers check the correctness, but it is even less overhead to just let the author check it. So a comment is more appropriate.
    – AlexS
    Commented May 7, 2014 at 14:08
  • 10
    Moderators (similarly to edit reviewers) shouldn't be expected to have the kind of in-depth knowledge to be able to tell whether or not the code is bad, thus a moderator flag doesn't seem particularly appropriate. The close vote queue is for just that - closing questions. If the flag requires domain knowledge to be actioned, you can probably expect it to just get declined. If there's a major enough flaw in the answer, you can downvote it - a moderator may delete a post if it manages to get a negative score. Commented May 8, 2014 at 3:04
  • Couple of points to note: a moderator can't "send this post to the close votes queue", their votes are binding so if they vote to close, the post is closed - that is the power of the diamond. Secondly, you can't "close" an answer, only flag it (which will probably result in insta-deletion from the binding vote) or delete it. Commented May 9, 2014 at 11:43
16

Because

  1. the edited answer is not really an improvement,
  2. the change is minor, and
  3. the answer was already accepted.

So the voters had good reason to reject the modification.

6
  • 6
    I can live with 2 and 3, but deleting non-functional code IMHO is a improvement especially in an accepted answer.
    – AlexS
    Commented May 7, 2014 at 13:45
  • 7
    @AlexS It's non-obvious it's an improvement to someone reviewing the edit. Instead, you should have edited to include example values (or some indication that values should be given) for a valid constructor. This is both a bigger improvement, and much more likely to show it's merit in a review. Commented May 7, 2014 at 21:37
  • 1
    I agree that the voters had good reason to reject the modification, but I don't agree with the reasons you listed - as Lattyware mentioned, whether or not it's an improvement is not obvious - it's not that it simply isn't an improvement. I wouldn't call the change minor, in fact, I might even go for "radical change" as a reject reason. The fact that the answer is accepted should play no role in whether or not an answer gets accepted. Commented May 8, 2014 at 3:07
  • @Lattyware There is more to it than a simple constructor (otherwise I would have cared about it I think). It would have blown the edit. Thus I also provided an additional answer (right before I did the edit, so that reviewers might see it).
    – AlexS
    Commented May 8, 2014 at 7:05
  • 1
    That's funny this answer: meta.stackoverflow.com/a/253863/284111 is arguing that the change is MAJOR so it's wrong, and your answer is arguing that the change is MINOR so it's wrong - amusing as hell. So we don't do minor change don't do major changes, what the purpose of editing other people posts than in your opinion? Commented May 8, 2014 at 21:32
  • I never said that the change being minor means it is wrong, just that that is grounds for rejection. Over and out.
    – Roy Dictus
    Commented May 8, 2014 at 22:17
3

The only edit to an answer's code I would accept is a blatant typo correction on an inactive user's post. An edit should never substantively change the OP's intent.

What you should do:

  1. Downvote the answer; you have the right to call out problems you see in any post.
  2. Explain the error in a comment for the benefit of others, and so the OP has an opportunity to fix it.

Looks like you did that eventually.

2
  • 1
    What's wrong with correcting a blatant typo on an active user's post, where the intention of the post is very clear? Downvote + explaining + OP fixing it doesn't benefit anyone.
    – gnasher729
    Commented May 9, 2014 at 12:18
  • Fair enough, point being that nearly all edits that change an OP's code are discouraged, especially if they're still around to clarify. Changing the output of code changes the meaning of the post.
    – Brad Koch
    Commented May 9, 2014 at 13:35

You must log in to answer this question.

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