94

Is it considered plagiarism on Stack Overflow to take material from another answer on the same question and reuse it with modifications?

Details

I recently answered a question which had been partially answered by another user. It seemed to me this answer had started well and then lost the thread of the task at hand. There was code that would not compile and the answer did not answer the actual question.

I added a comment to the answer saying it would not compile and did not answer the question.

The answerer replied (paraphrased) they had done enough to get the user in the right direction.

So I copied some of the code from this answer, fixed it so it solved the problem in a way that the OP would understand and posted it as a new answer.

I was then accused of plagiarism

At this point I started getting downvotes. I can only assume I was getting the downvotes because of perceived bad behavior -- since my code worked while the other answer did not even compile.

So my question is this:

Is it considered plagiarism on Stack Overflow to take material from another answer on the same question and re-use it with modifications?

Do we need to point to material which is on the same page? Did I overstep some bound here?

I don't want to be the high-rep bully here, this is a new user trying to add to the site and I feel I gave him a chance to answer the question first. At the same time I don't like being accused of something I didn't do according to the standard of this site.

Question for reference: A better way to fill a two-dimensional array with date and zodiac sign


Clarification - I'm specifically asking about not having attribution in the text of the answer since I was originally lazy and did not include it. Since it was on the same page as the answer I was enhancing, it seems clear to me (maybe only as an experienced user who knows SO) where the original code came from. This is what my question is concerning.

13
  • 1
    It's been only one downvote though
    – Pekka
    Commented Apr 20, 2014 at 15:59
  • @Pekka웃 - Yes if you look at the history that changed when I edited the answer to include attribution
    – Hogan
    Commented Apr 20, 2014 at 16:01
  • 21
    Aside from blatant copy-pasta, when does an answer become a Ship of Thesus? If you're going to be upset with people using your code, I suggest not posting it in such a public place; you're setting yourself up for frustration. There's a copyright, great -- how much time are you willing to spend defending the integrity of your ownership over some random snippet you posted to help a dude align his HTML? Again, I question the common sense of anyone who participates in such a public forum and feels so protective over their offhand entries. Commented Apr 21, 2014 at 20:02
  • 3
    @Chris: It's not the use that people get upset over. It's the use without attribution. As for the Ship of Theseus reference: whether it's the same answer is not the only question. The revision history, and the OP's own statements, could be used to argue that the original code laid the foundation...and had it not existed, the OP's answer wouldn't have existed either. (You have a bit of a point in that most people -- including myself -- would consider them totally different answers today, if the history weren't there for all to see. But the evidence makes the point at least quite debatable.)
    – cHao
    Commented Apr 24, 2014 at 0:51
  • Too late already read it ;)
    – user692942
    Commented Apr 30, 2014 at 14:57
  • 3
    When I take code/content from another question I always say 'as this answer shows' with the text hyperlinked to point directly to that answer. I also do the same for comments and although some users do get annoyed when I post an answer using their suggestion/code they placed in the comments, it's ultimately their fault for not writing up the answer in the first place.
    – AStopher
    Commented Dec 11, 2014 at 23:25
  • Hogan, why roll back @PeterMortensen 's edit?
    – CubeJockey
    Commented Oct 3, 2016 at 14:01
  • @CubeJockey - because it is my post and I didn't like them. All of them were stylistic except my missing one "the" which I added myself. If you look at the history you will see there is a long "fight" over how I worded the title. These edits were (IMO) made quickly.
    – Hogan
    Commented Oct 3, 2016 at 15:14
  • I'd reconsider -- it seems this post could serve as something of a canonical reference. I do feel the latest edit (correct naming of StackOverflow.com, down votes, etc) are worth preserving. Not to mention the numerous title corrections you insist on defering. "it is my post and I didn't like them" is unfortunately irrelevant at this point. In any event, I see the edit history and won't involve myself.
    – CubeJockey
    Commented Oct 3, 2016 at 15:25
  • 1
    @CubeJockey - as I've said before "an other" is more correct. This answer explains why: english.stackexchange.com/a/119503/2488 . Changing Stack Overflow to StackOverflow.com seems 100% stylistic to me -- please explain how this is more "correct naming"?
    – Hogan
    Commented Oct 3, 2016 at 15:43
  • @Hogan I saw the same thread on the English SE :) Before commenting, I referred to the higher-voted, accepted response (the author of your referenced post also later comments with some doubt on their answer). I am not invested in this, so do with it what you wish. I will admit my phrasing for "correct naming" doesn't offer any significance.
    – CubeJockey
    Commented Oct 3, 2016 at 16:10
  • 2
    @Hogan I was going to make a similar comment as CubeJockey. I'll give you the another vs an other, but the changes to how you reference the site are not stylistic. There is actually guidance ln how to reference the site's name in the trademark guidance, so editing StackOverflow.com to Stack Overflow is just conforming to that guidance (stackoverflow.com is also acceptable) Commented Oct 4, 2016 at 7:21
  • @psubsee2003 - you bet, I never saw the guidance page, I changed it.
    – Hogan
    Commented Oct 4, 2016 at 14:24

9 Answers 9

138

Is it considered plagiarism on Stack Overflow to take material from another answer on the same question and re-use it with modifications?

As stated by Pekka in his answer: "No. You are expressly permitted to do so - as long as you give attribution."

Do we need to point to material which is on the same page?

Yes, you do. It doesn't matter where you got your content from; if it's not yours you explicitly have to state so, state who the author is and link back to the original content. Each answer has a direct link, so you can always use that.

9
  • 92
    Attribution inside an answer that answers whether attribution is required :-) Commented Apr 22, 2014 at 11:13
  • 27
    Meta goes meta! Commented Apr 23, 2014 at 20:30
  • 2
    And a convenient form of such attribution could be: "Improving on John Doe's answer (linked) ..."
    – PM 77-1
    Commented Apr 27, 2014 at 23:10
  • Joe makes a point about fair use. I think there's an additional consideration concerning whether the copied content meets the basic requirements of intellectual property If it does not, then there is no need for a license and the CCBY-SA rules don't apply.
    – Ben Voigt
    Commented Apr 28, 2014 at 17:55
  • Yep @BenVoigt, as stated here: wiki.creativecommons.org/…
    – Bart
    Commented Apr 28, 2014 at 18:01
  • So... What should I do if I find an answer which is copied from another post? Only comment? Flag? Commented Apr 29, 2014 at 12:56
  • 1
    You could politely comment, perhaps even link to this question @Manu. Or you could flag. Particularly so if you find that the user is plagiarizing more than just a bit of content (several posts for example) without any attribution.
    – Bart
    Commented Apr 29, 2014 at 12:57
  • The attributing of attribution is making my head spin Commented Aug 22, 2014 at 17:11
  • 1
    @Luke Stanley you should have attributed this idea to Amal Murali.
    – Mundi
    Commented Jul 23, 2015 at 15:15
65

Is it considered plagiarism on Stack Overflow to take material from another answer on the same question and re-use it with modifications?

No. You are expressly permitted to do so - as long as you give attribution.

7
  • My point is without attribution -- that is what I originally had.
    – Hogan
    Commented Apr 20, 2014 at 16:02
  • 8
    @Hogan "user contributions licensed under cc by-sa 3.0 with attribution required". If you don't give attribution, you're breaking the rules.
    – gunr2171
    Commented Apr 20, 2014 at 16:03
  • @gunr2171 - of course, my point is it is on the same page and should be clear (via timestamps) who wrote what when. I'm was not trying to take credit for anything -- I was just in a hurry.
    – Hogan
    Commented Apr 20, 2014 at 16:07
  • 11
    @Hogan Providing attribution is really really important.
    – Pekka
    Commented Apr 20, 2014 at 16:28
  • 2
    @Pekka웃 -- yep that seems to be the take away, so far no one seems to agree with my same page point of view, of course there have been many times over the past 4 years when my work has been used without attribution but I've long since gotten over being sensitive about it.
    – Hogan
    Commented Apr 20, 2014 at 17:06
  • 18
    Consider the fact that your answer is itself under the same license, @Hogan, and can be reused in a different context, separate from the other answer. Then it will no longer be "on the same page", and no one will have any idea that your work is derived from someone else's.
    – jscs
    Commented Apr 20, 2014 at 19:41
  • 1
    @JoshCaswell - excellent point... this makes perfect sense. I had not considered this issue.
    – Hogan
    Commented Apr 20, 2014 at 19:51
26

It is not clear to me that any of the folks responding here took a close look at the specifics of this situation. They seem to be giving the generic, boilerplate answer: Yes, attribution is required. Of course, honor copyright.

Specifically, the situation you posted does not look anything like "plagiarism" in your answer, especially after all the edits. You posted his code and refactored it in several ways, ending up with fundamentally different code all together. In my view it becomes a Ship of Theseus. Do you use an array? Does he? Sure. So are they the same code? No, absolutely not. No individual holds a copyright on using arrays in code.

Had you developed your final answer in Notepad instead, going through the same cycle of revisions that we see on the answer, no one would have ever suggested your answer is related to the other one at all. I may not hold a majority view on this, but I don't think you did anything wrong, and I don't think you need to be apologetic for your volunteer effort to help a fellow user. You made a good contribution, and solved someone's problem. Good work.

Should you attribute when you directly use someone's complete code? Yes, absolutely. When you are inspired by someone's code? It is nice, but not required. When your code bears a passing resemblance to other code because it uses the same language constructs? Nope.

Aside I personally don't hold too much attachment to code I post on this public forum -- I don't care if anyone attributes me. I put it in a public place for the express purpose of being taken and used by other people. To me, if I were at all concerned about protecting my ownership of code, the very last thing I would do with it is post it on a Google-indexed website that doesn't even require registration to view it. Other people might have a different view, I'm sure, but it seems to me they're setting themselves up for frustration. What happens to publicly available code? It gets taken and used. Don't want that to happen? Don't post it in public. Don't like sharks? Don't go in the ocean. Want to go in the ocean? Prepare yourself for sharks.

3
  • 1
    Thanks for the kind comments Chris. My revised view is the first version should have attributed. That version did not last long.
    – Hogan
    Commented Apr 21, 2014 at 22:00
  • 4
    @cHao What are you responding to? You're doing the very thing Marcin referring to. No one disagrees with copyright law, especially not him. No one is here making a contrary point to yours. So you're just regurgitating the same knee-jerk nonsense. Yes. Copyright exists, and we should respect it. Was this specific situation related to copyright? No. But you'd have to have invested the 5-10 minutes necessary to looking at the details to know that; much easier to blather on about your undying support for copyright law. Your passion is appreciated and duly noted, if apropos of nothing. Commented Apr 23, 2014 at 22:42
  • 2
    @Chris: Yes, this specific situation is related to copyright, in that the answer in question was a derivative work, and the original author should have been credited. Period. But, as the OP himself stated, he copied part of an answer without mentioning who wrote the original. That is the biggest (possibly even sole) reason for the downvotes. Note that with that issue corrected, there is only one downvote on the answer.
    – cHao
    Commented Apr 23, 2014 at 23:47
9

Help Center > Answering


How to reference material written by others

Plagiarism - posting the work of others with no indication that it is not your own - is frowned on by our community, and may result in your answer being down-voted or deleted.

When you find a useful resource that can help answer a question (from another site or in an answer on Stack Overflow) make sure you do all of the following:

  • Provide a link to the original page or answer
  • Quote only the relevant portion
  • Provide the name of the original author

Example:

According to this biography, Hemingway saw combat when he was a teenager. It says:

After the United States entered the First World War, he joined a volunteer ambulance unit in the Italian army. Serving at the front, he was wounded, was decorated by the Italian Government, and spent considerable time in hospitals ....

[other sources, quotes, explanations, etc. necessary to complete the answer]

Do not copy the complete text of external sources; instead, use their words and ideas to support your own. And always give proper credit to the author and site where you found the text, including a direct link to it.

See also:

10
  • 23
    This answer looks like plagiarism! ;)
    – mah
    Commented Apr 21, 2014 at 20:26
  • 2
    @mah Yes, but: 1. I linked to the page; 2. I quoted only relevant portions (mostly); 3. I would have provided the name of the author, but there wasn't one. Oh, and I did write this answer partly just to be funny. ;) Commented Apr 21, 2014 at 20:30
  • 4
    It's ok; I commented just to be funny too ;)
    – mah
    Commented Apr 21, 2014 at 20:31
  • 7
    Oh nos, I wore a hat one time, I'm a plagiarist now.
    – Hogan
    Commented Apr 21, 2014 at 21:57
  • 2
    @Hogan Gasp How dare you! Commented Apr 21, 2014 at 22:22
  • 3
    This answer looks like plagiarism! ;) Commented Apr 20, 2016 at 14:01
  • 1
    This answer looks like plagiarism! ;)
    – Gogol
    Commented Apr 20, 2016 at 14:08
  • 2
    @guest420420 your comment is plagiarised from Yakk and mah 's comment!! ;)
    – Sonic Atom
    Commented Apr 20, 2016 at 15:08
  • 1
    Ouch noh! Must have been a coincidence 😀 @SonicAtom
    – Gogol
    Commented Apr 21, 2016 at 15:03
  • This answer looks like plagiarism ;) source
    – NinjaKitty
    Commented Mar 21, 2018 at 22:51
9

CC-Wiki disclaimer at the bottom of every page

site design / logo © 2014 stack exchange inc; user contributions licensed under cc by-sa 3.0 with attribution required

So by submitting an answer, you agree to that license term. Meaning replicate as often as you want : with attribution.

This also applies to taking the answer outside of stack exchange network.

There is however a not so obvious gotcha in the "attribution required" page. Other then the obvious (attribute stack-exchange, author, hyperlink the answer)

  • Hyperlink each author name directly back to their user profile page
  • All links (including the answer link) must not be nofollowed.
4

From unknown source, paraphrased:

To copy a piece of text, whether one line or 20 pages, with or without changes, from one source, is called plagiarism. To copy from more than 2-3 different sources is called research :-)

Seriously now, from dictionary.reference.com:

pla·gia·rism (noun) 1. an act or instance of using or closely imitating the language and thoughts of another author without authorization and the representation of that author's work as one's own, as by not crediting the original author.

(emphasis mine). The authorization part is not really needed here (and in many other places), but the rest holds.

Being actively involved in writing scientific publications, my advice is to avoid plagiarism by always citing your sources and only copying or summarizing what is absolutely necessary for understanding your own text, leaving the rest to the original source.

Do this in your life in general, be it in a small community like stackoverflow.com or anywhere else. Not because "some rules" say so, but because you feel it, and because it's the right thing to do.

A rule of thumb against "laziness": cite first, then copy.

3

It would seem to me that in this particular case you should have edited the answer to improve it. From https://stackoverflow.com/help/privileges/edit,

When should I edit posts?

Any time you feel you can make the post better, and are inclined to do so. Editing is encouraged!

Some common reasons to edit are:

  • to fix grammatical or spelling mistakes
  • to clarify the meaning of a post without changing it
  • to correct minor mistakes or add addendums / updates as the post ages
  • to add related resources or hyperlinks

Try to make the post substantively better when you edit, not just change a single character. Tiny, trivial edits are discouraged.

6
  • 2
    I don't think you looked at the post in question.... There was nothing minor about the edits needed... I copied the first 5 lines or so of 15. Then I found those did no work when I tested it and ended up changing them.
    – Hogan
    Commented Apr 23, 2014 at 22:28
  • 2
    @Hogan No one looked. You've created a fantastic opportunity for people to showcase their conspicuous Good Net Citizen behavior; the actual details of the situation no longer matter. All that matters is making another post demonstrating how honorable and upright the answerer is, which other upright and honorable people will upvote. Your actual question is only a means, preaching about copyright law to the choir is the end game. Might as well sit back and let them get it out of their system, they get bitey if you try and stop them. Commented Apr 23, 2014 at 22:48
  • 1
    Edits that fundamentally changes the content of the post are also discouraged. Which I would think applies in this case, but this is obviously very subjective.
    – eandersson
    Commented Apr 28, 2014 at 11:13
  • 1
    @Hogan: In the defense of the people not looking at the post that led to this, your question is not at all about the particulars of that post, and the link appears to be an afterthought. The fact that you had to rewrite the code completely, and merely cut+paste as a starting point, is relevant and ought to be emphasized in the question.
    – Ben Voigt
    Commented Apr 28, 2014 at 17:49
  • @BenVoigt - Thanks for your comment. I think I'm more interested (as is the community) in a general answer to the question -- but it is true this specific case is what prompted me to ask the question. In this case I think we were both right, what I "copied" was very minor and the person I copied if from was entitled to be upset. Thus the next time I will call out such a quote even on the same page.
    – Hogan
    Commented Apr 28, 2014 at 18:00
  • In this case, since the original answerer thought that only pointing the poster in the right direction was the appropriate thing to do, the edit would change the meaning of the answer and thus not be a good edit.
    – Warren Dew
    Commented Apr 29, 2014 at 3:47
2

I would say that degree matters to some extent. If you took something important to the answer, then I agree it needs attribution.

However, if someone has a small amount of sample data in their answer, I probably don't always remember to attribute it (particularly if I borrow it, go away for a few hours, eventually come back), and it's something like 5 rows of A B C D E. I think that's okay. It's not relevant to the answer, it didn't take any significant work to make, and makes it easier to compare solutions in any event. It's sort of a Fair Use scenaio (and may be in a legal sense).

1
  • I think this is the correct answer. For example, if the question included a sequence of 20 numbers separated by spaces, and another answer has the same data separated by commas, I see no issue with copy+pasting the version with commas instead of the version with spaces, and see no attribution required. There is no intellectual property associated with the completely mechanical task of changing the separator.
    – Ben Voigt
    Commented Apr 28, 2014 at 17:53
-2

In my opinion, yes, it was plagiarism, since you started with the other poster's answer but did not give attribution. This is true even though your modifications were extensive.

Note that it would not be plagiarism if you wrote your own answer from scratch. This would be true even if you ended up with the exact same answer.

The issue is that you saved yourself work by starting by copying. Making an attribution is considered to appropriate thanks for the work that you were saved.

You must log in to answer this question.

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