30

Many a time I have seen the OP forget to add code to their questions. When asked by any other user, the OP posts it as a comment or a jsfiddle.

Now, despite a reminder if OP does not update their question with the code a user Suggests an Edit to post, then should the edit be rejected?

As a reviewer many of us will not have time to view the question and read the comments so I guess the editor should post a comment to his edit that "Code added from comment" or something along these lines.

What should I be doing? As of now, I accepted the edit but as the edit got rejected I pasted the code to the question body. Is this the correct action?

12
  • 2
    I saw many suggested edits like these and I approved them if the question is in my area . Commented Jun 10, 2015 at 14:45
  • 11
    That looks like a reasonable edit. "This edit defaces the post in order to promote a product or service, or is deliberately destructive." makes no sense as a reject reason. Commented Jun 10, 2015 at 14:46
  • @BilltheLizard: I too feel the same. No offense to anyone but the reject reason where little strange.
    – Shubh
    Commented Jun 10, 2015 at 14:49
  • 21
    The editor did not says he included the code from comments so reviewers did not realize where it comes from .I would reject that edit because I do not know where those comes from. Commented Jun 10, 2015 at 14:50
  • 8
    @ShaifulIslam Yeah, it would have helped if they had done that. Still, if I'm not sure I can just click the link and see if the code came from the OP or not. Posting code in comments is common enough that we should expect it. Commented Jun 10, 2015 at 14:52
  • 19
    "Improved formatting" is a really terrible and inaccurate comment for that edit. Without looking at the post, reviewers have no idea where the code came from. In this case, if you don't have time to look at the post then you should skip. But in this case, it looks like the right choice.
    – codeMagic
    Commented Jun 10, 2015 at 14:52
  • @ShaifulIslam- I would agree with you. The comments for Edit should hold a proper message.
    – Shubh
    Commented Jun 10, 2015 at 15:31
  • Any means we can approve the edit and the unsung hero gets his minimal token of appretiation ? :)
    – Shubh
    Commented Jun 10, 2015 at 15:33
  • 4
    One thing to watch out for is that adding code from a JSFiddle could violate the authors copyright (even if they asked the original question), as by adding it to SO you're putting it under a creative-commons license, but I'm not sure everything on JSFiddle need be a compatable license. That may be reason enough to reject the edit. Commented Jun 11, 2015 at 5:20
  • If the edit repairs issues with the post, then I can't see why the edit should be rejected. The edit reason should have a 'edited in code from a comment from the OP' edit reason.
    – AStopher
    Commented Jun 12, 2015 at 10:37
  • 1
    but then, any edit which edits in Please suggest should be nuked instantly...
    – AStopher
    Commented Jun 12, 2015 at 10:49
  • 3
    As a reviewer many of us will not have time to view the question and read the comments If you don’t have the time to look at the comments it is not the right moment to do reviews.
    – idmean
    Commented Jun 12, 2015 at 19:41

2 Answers 2

45

The reviewers probably should have been more diligent, since adding so much code is usually done for a reason. If I did not know that the code came from the OP via a comment, I would have rejected it for "clearly conflicts with author's intent", instead of the reasons they chose.

The person suggesting the edit could have been more clear in the edit comments. A lot of times, the suggested edit has a comment like "including code from comments" to help alert reviewers that this code actual does belong to the OP.

As for your actions, you did the right thing. The suggested edit was a legitimate improvement to the post. And editing the question itself after the suggested edit was (somehow) rejected is great. It still greatly improves the post by including the OP's code. Ideally, the suggested edit would have been approved, and the suggester would have been properly rewarded, but that should not stop you from editing the question if the review system fails.

3
  • Any means we can approve the edit and the unsung hero gets his minimal token of appretiation ? :)
    – Shubh
    Commented Jun 10, 2015 at 15:33
  • Only while the suggested edit is still pending. If it is still pending (not yet rejected) the Improve Edit button automatically approves the suggested edit and then lets you make an additional edit. This gets around the 3 votes needed to approve/reject the edit.
    – ryanyuyu
    Commented Jun 10, 2015 at 15:36
  • 1
    @Shubh yeah not much we can do after the fact. At least it's only 2 rep and some recognition.
    – ryanyuyu
    Commented Jun 10, 2015 at 15:38
7

I would consider any edit that inlines code from a JSFiddle or other source, by anyone other than the codes original author as being a bad edit - unless the code has some other obviously compatible license attached to it.

The reason being that code on JSFiddle need not be covered by a license compatible with SOs creative-commons license.

For example JSFiddle has this in their legal section

All code belongs to the poster and no license is enforced.

Which clearly means it does not necessarily become creative commons when posted. So reposting it without the authors permission is potentially a copyright issue.

5
  • 2
    That is a very interesting observation. Editing in code from comments is no issue since it's still on SO, but you definitely have a point if the code comes from elsewhere.
    – Raniz
    Commented Jun 12, 2015 at 9:14
  • IMHO this doesn't exactly address the question; the question's about users posting their own code as a comment, someone suggests an edit with the code, and their edit is rejected.
    – AStopher
    Commented Jun 12, 2015 at 10:44
  • IMHO, it partially addresses the question, since many times the code does not fit into a single comment, or looks like crap, so the user that tried it moves it to fiddle or similar service.While not the same case, it is very close to the subject and while I really doubt that this someone would in such case look at that fiddle closely and take care to set a proper SO-compliant license, I also doubt that they would later sue anyone for copying-pasting the code back to SO. However, after someone edits their post like that, the original author of the code certainly could start legal actions. Commented Jun 12, 2015 at 11:32
  • 1
    One could argue that posting on SO the code written by someone on a public page whose link was posted by the same person on SO falls into fair use. In any case No licence is enforced seems like extremely bad wording to me... Very related: meta.stackexchange.com/questions/115056/… programmers.stackexchange.com/questions/26548/…
    – nico
    Commented Jun 12, 2015 at 11:47
  • @humble.rumble: You have a serious misunderstanding about what is allowed without a license. It certainly is NOT "the code could be used wherever for whatever reason". Without a license, the only allowable uses are the ones guaranteed by the government (Fair Use, for example).
    – Ben Voigt
    Commented Jun 12, 2015 at 20:19

You must log in to answer this question.

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