83

What is the view on the ethics at copying the code you find on Stack Overflow? My issue is that I posted a whole source code for a short project where I could not find a small bug that was causing my program not to work. The next day I saw a fellow student using identical code and even asking me about some other assignment where we reuse this same code and slightly modify it. We have to submit our work in few days and probably he will use my code.

Can a person do that without stating who is the author and can I prove my authorship with a Stack Overflow post?

7
  • 161
    ...one of the reasons why it's a good idea to only provide an MCVE in questions.
    – radoh
    Commented Dec 7, 2016 at 9:18
  • 79
    Have in mind, that when ever you publish something on Stack Overflow, it's under Creative Commons licence
    – xenteros
    Commented Dec 7, 2016 at 9:21
  • 9
    Also bare in mind that it is attached to you on here, it is easy to find out he copied you
    – Sammaye
    Commented Dec 7, 2016 at 10:54
  • 33
    Honesty is forever the best approach, matters a great deal as well once you get employed. IP is a very big deal. You'll have to disclose to your teacher what happened. That this makes the teacher aware that you did not complete the assignment completely by yourself is the inevitable consequence. So be it. Commented Dec 7, 2016 at 13:36
  • 38
    This almost feels like a question for Academia.
    – Ajedi32
    Commented Dec 7, 2016 at 14:22
  • 11
    At the bottom of every page it says "user contributions licensed under cc by-sa 3.0 with attribution required"
    – OrangeDog
    Commented Dec 7, 2016 at 15:03
  • You can't prove it (answers already explained why) even if he is going against SO license. However you can do it better: post it on Code Review... Commented Dec 9, 2016 at 12:21

8 Answers 8

51

On Stack Overflow all user content, including code snippets, is posted under a version of the Creative Commons Attribution-ShareAlike license.

Share — copy and redistribute the material in any medium or format

Adapt — remix, transform, and build upon the material for any purpose, even commercially. The licensor cannot revoke these freedoms as long as you follow the license terms.

Attribution — You must give appropriate credit, provide a link to the license, and indicate if changes were made. You may do so in any reasonable manner, but not in any way that suggests the licensor endorses you or your use.

ShareAlike — If you remix, transform, or build upon the material, you must distribute your contributions under the same license as the original.

No additional restrictions — You may not apply legal terms or technological measures that legally restrict others from doing anything the license permits.

So answering your question, it was plagiarism, as the other student must indicate that the author of that code is you.

If you didn't post the whole code it would be more complicated because general patterns are not protected by author's law. What I mean, is that a solution of a problem which is a general pattern doesn't need to be remarked as it's not protected, but if you show code which has some business logic, this makes it author's law protected.

According to Wikipedia:

Plagiarism is the "wrongful appropriation" and "stealing and publication" of another author's "language, thoughts, ideas, or expressions" and the representation of them as one's own original work. The idea remains problematic with unclear definitions and unclear rules.

11
  • 8
    As the author stated the other student hasn't disclosed that he copied his code, so that could be considered act of plagiarism. Commented Dec 7, 2016 at 9:27
  • 4
    @MarošBeťko of course it is act of plagiarism.
    – xenteros
    Commented Dec 7, 2016 at 9:28
  • 3
    Sorry I've posted this comment before you completed your conclusion in your answer. Commented Dec 7, 2016 at 9:30
  • 121
    While that covers the licensing stuff, what is or isn't plagiarism is not a licensing question. Even if the code was released in the public domain and the fellow student was, licensing-wise, perfectly in compliance even without an attribution, it might still be plagiarism. The rules regarding plagiarism are set by the academic institution, not the author of the copied code. Plagiarism and piracy are distinct questions.
    – adhominem
    Commented Dec 7, 2016 at 9:49
  • 111
    The license is completely irrelevant to whether the student has plagiarised. You can infringe copyright without plagiarising (e.g. by seeding a Hollywood movie on BitTorrent; you're distributing it without their consent but not claiming to have made the movie), and you can plagiarise without infringing copyright (e.g. by passing off a sonnet of Shakespeare's as your own work to a gullible girlfriend). Talking about licensing in a question about plagiarism makes no sense at all.
    – Mark Amery
    Commented Dec 7, 2016 at 10:19
  • 1
    You've got the version wrong. It's 3.0 not 2.5.
    – OrangeDog
    Commented Dec 7, 2016 at 15:03
  • 1
    I think you got the wrong licence. The footer says: "site design / logo © 2016 Stack Exchange Inc; user contributions licensed under cc by-sa 3.0 with attribution required"
    – Peilonrayz
    Commented Dec 7, 2016 at 15:07
  • @Peilonrayz it must have changed recently. Updated my answer.
    – xenteros
    Commented Dec 7, 2016 at 15:10
  • 7
    If by "recently" you mean over five and a half years ago, then yeah it was pretty recent and you probably missed it... Just admit that you didn't look at the footer. It's OK.
    – BoltClock Mod
    Commented Dec 8, 2016 at 16:03
  • 6
    @MarkAmery "passing off a sonnet of Shakespeare's as your own work to a gullible girlfriend" Wow, does that work? Thanks for the tip!
    – matt
    Commented Dec 8, 2016 at 19:39
  • @BoltClock I didn't. I based on meta.se.
    – xenteros
    Commented Dec 8, 2016 at 20:09
37

Since the other answer didn't address this, here's the crux of your issue

Can a person do that without stating who is the author

They already did. This is a common problem on SO. We're here for people to ask questions and get answers. While it's concerning that people are using SO to basically cheat academically, it's also not exactly our problem to fix. A great example came from Brad Larson recently:

Usually, it's the exact opposite, where professors threaten to automatically fail any student they find posting here. Thus, the tons of "urgent, I need to delete this question" flags we get around finals time.

At this point it's your problem to fix. How? That's something neither SO, nor Meta.SO can answer. You might want to try over at Academia.SE, where they have a whole tag on that (refer back to both this and your SO question if necessary). I would presume that there's some sort of integrity being violated here but I can't say for certain.

can I prove my authorship with a Stack Overflow post?

Not really. You posted it, but proving he didn't have that code until after you posted it, becomes a "he said/she said" problem. Where did you get it from? And if they claim it was theirs first and you stole it from them you're sort of up a creek.

1
  • I can understand teachers who prepare list of sources and tools available. Then people come to work and don't use available libraries as they're thought to write everything on their own.
    – xenteros
    Commented Dec 11, 2016 at 9:35
10

The issue is not with CC licenses or SO policies. The issue is with your school's policies about academic fraud. Submitting another student's work as your own is plagiarism. It does not matter if the work is licensed or not.

Approach your department administration with the evidence that it is your work. It does not matter where or how the offender(s) got your work - all that matters to the school is that they are fraudulently submitting it as their own.

Any school worth its salt can aggressively require two or more people to defend the same work and determine who the original author is. Consider it practice for a grad thesis.

2

I would suggest if you can explain your code and understand it, then your tutor will see through that. I had a similar issue with Plagarism on my degree (11 years ago (I feel so old)) and was, in effect, interviewed about it. Part of that was explaining the code. From my explanation of the code and reasons for my approach, I wasn't penalised (but was warned). It's generally software that detects plagarism (and no, changing variable names won't help), but then the Tutor will speak to both parties about the incident. Obviously, it was a while ago since I went to Uni, but presume this is still the case.

I would suggest in the future to not post the whole solution. Post the areas you think relevant, and add more code to it as and when needed. The community is pretty good at knowing when they need more or not (or even guessing how you have done the lead up to the code displayed).

In terms of claiming ownership, that's not possible. What's to say you didn't copy him, then got stuck so asked on SO? I'm not saying you did that, but it's feasible that you did.

2
  • It was my mistake posting the code here. I learned a lesson from all this. Thank you for your reply.
    – user5654873
    Commented Dec 9, 2016 at 9:57
  • No problems. I have been through a similar situation so know the feeling. As long as you haven't done anything wrong in terms of plagarising, if it is flagged as such, explain your position and i'm sure it will be OK. Commented Dec 9, 2016 at 10:42
2

You should be taking your lead on how to address a situation like this from your institution's written academic conduct statement and how it defines plagiarism.

After reading that you should make an appointment with your instructor. You might take a hit for posting a project here and soliciting assistance on finding a bug but raising the issue now is better than taking the risk of being dismissed or at the very least being seen as complicit in supplying assistance to another student.

-2

Can a person do that without stating who is the author and can I prove my authorship with a Stack Overflow post?

Technically, no you can't really prove it. There is no way to prove this. It's kind of like if you were to grab a chicken and some eggs and took them to a market there is no way of proving if that chicken laid those eggs. Ultimately an egg is an egg.

Here is the bottom line: If your code has actually helped someone overcome an issue, you are a valued member of the SO Community and thank you! If someone took your code and is trying to use it as theirs, you can't prevent it but eventually they will hang themselves because you won't be there when they get their first job. If you don't know how to code, you won't last.

5
  • 6
    "If you don't know how to code, you wont last" I'd really like to believe that but I've seen to many people, who appear to code by virtue of probability, manage to keep their job at the expense of better coders.
    – Ouroborus
    Commented Dec 8, 2016 at 23:19
  • 3
    "there is no way of proving if that chicken laid those eggs" Sure there is! Just sequence DNA from the egg, and compare it to DNA from your hen and any other candidate hens. (My hobby: blowing holes in analogies.)
    – Cody Gray Mod
    Commented Dec 9, 2016 at 19:30
  • @CodyGray I guess you do have a point. Commented Dec 9, 2016 at 19:35
  • 1
    @CodyGray But what if the test results in the 1 in a trillion (or whatever the odds are) false positive? Compelling evidence, even when it's overwhelmingly beyond any reasonable doubt, is still different from proof. I mean, can you even prove that there is a chicken, or an egg, or that we're not in a computer simulation?
    – Servy
    Commented Dec 9, 2016 at 19:35
  • @Ouroborus Yes there are a lot of really bad coders out their. I have seen plenty in my life but ultimately if they are using SO to complete their assignment (instead of to be enlightened) they will ultimately end up failing. Commented Dec 9, 2016 at 19:38
-12

What is the view on the ethics at copying the code you find on Stack Overflow? My issue is that I posted a whole source code for a short project where I could not find a small bug that was causing my program not to work. The next day I saw a fellow student using identical code and even asking me about some other assignment where we reuse this same code and slightly modify it. We have to submit our work in few days and probably he will use my code. Can a person do that without stating who is the author and can I prove my authorship with a Stack Overflow post?

So to have it clear:

  • You posted your code, because you couldn't detect the problem yourself
  • Someone else with a similiar assignment found your post on StackOverflow
  • You want to put this down as plagarism

Before we go any further: Did you copy yourself stuff from StackOverflow (from other posts) that could've helped you?

If yes: Then you should undergo the same consequences as he does right? Since you have done plagarism too then.

If not: Then you're still having plagarism since you took either someone his solution on your own post or the fine-tuned code he gave you over, UNLESS you stated that it is his code / solution you are using (what you most likely have not done).

Now: If not mistaken, the moment you post on StackOverflow it will fall under the "creative commons license".

Now: I want to bet you still have looked up more stuff on StackOverflow for your assignment. Basically doing the same thing as your classmate did, take over the solution or code and adjust it so it fits your assignment.

So bottom line: You seem to be a hypocrite on this one. I am not trying to make you look foolish or trashtalk you, but this is how I see it.

You can downvote me as much as you want, but fact remains: He is a hypocrite on this one. Either undergo the same consequences or tell your little buddy to change his code a bit so you both can remain happy... or the third solution: Put in the authors in your code.

1
  • 6
    It seems that the first premise of your reflection here is severely flawed: "Did you copy yourself stuff from StackOverflow (from other posts) that could've helped you?" becoming "Since you have done plagarism too then." is simply false. Copying a snippet of code is not plagiarism, for reasons evidenced in the answers here. The rest is... petty name calling, seems an apt description. Commented Jul 13, 2018 at 20:11
-34

Plagiarism generally refers to copyrightable material. Code is generally considered to be patentable. So I don't know if plagiarism relevant to the stated situation. Whether copying code snippets from sites like Stack Overflow constitutes cheating, is a question for your instructor and is a separate issue from complying with the terms of the license.

5
  • 1
    Whether copying code snippets from sites like Stack overflow constitutes cheating, is a question for your instructor and is a separate issue from complying with the terms of the license. That's true, and that separate issue that's relevant in an academic context and that is separate from the licence is called Plagiarism. But yes, the whole question is about that, and has nothing to do with licences, copyrights, or patents.
    – Servy
    Commented Dec 7, 2016 at 14:57
  • It appears nobody likes my answer (lol). Stack overflow is all about sharing solutions which inevitably involves sharing code. Sharing code is generally considered a no-no in academia, though Stack Overflow has helped me to 'self educate' on many topics over the years. Commented Dec 7, 2016 at 14:59
  • 12
    "Plagiarism generally refers to copyrightable material." – Wrong. See the other Mark's comment. Commented Dec 7, 2016 at 15:24
  • A somewhat scary level of confusion between different restrictions on copying things.
    – jwg
    Commented Dec 8, 2016 at 15:58
  • Nothing like a bad q or a to help with the "self-education", eh? @Servy kicked my butt once and after a couple of days stewing over it, I took it as a well-earned, well-learned lesson.
    – Clay
    Commented Dec 9, 2016 at 19:29

You must log in to answer this question.