7

Another developer claims that certain fragment of my code has been "copy-pasted from the web". This is simply not correct, I wrote the code myself and understand it well. The code also works as expected.

How to respond in a professional way to such a claim? Do I need to respond differently if the claim has been repeated for the second or third time? This probably should be some short reply, putting the burden of evidence on the person who raises the claim, not on me.

Let's assume that the code itself is fine, not copy-pasted. The words come from my supervisor but I am convinced he just rephrases claims of the known another person more or less of my level in the hierarchy.

There is a question disciplinary infraction but seems not applicable for my case. I really have no idea how to provide "emails, written documents, and find people who will be able to back up your story" that I has been sitting and writing this code myself.

  • 6
    "There's the code, there's the unit test. If you have additional test cases that fail with this solution, I'd be happy to include them." – pmf May 5 '17 at 7:32
  • 3
    How big is this fragment? Why does your peer care that it might be copy pasted from the web? I copy snippets from the web all the time. I'm not seeing the point of writing a shallow modification of something that's already available. – Erik May 5 '17 at 8:18
  • 5
    Is it against your company rules not to copy code from the web? Pretty sure it's common for most developers in some way – ayrton clark May 5 '17 at 9:02
  • 3
    Small snippets are below the threshold for copyright. See this answer about copying from SO. I do it all the time, my job is to solve problems, not be entirely original. As long as you also understand it and can adapt it, it's fine. – Nathan Cooper May 5 '17 at 9:06
  • 3
    Add more context on how the claim was made and what the developer/supervisor expect. For example, a passing remark "this looks copy-pasted" would warrant one kind of response; a direct request from your supervisor "this looks copy-pasted; please rewrite it" would warrant quite another. – Brandin May 5 '17 at 9:21
15

If your colleague is so persistent about these accusations, you could respectfully ask them to show evidence of where they have seen your supposedly copy-pasted code. Based on your post, it seems they haven't done that.

When you say your colleague is disputing a 'fragment' of code, I'm guessing it's a fairly small piece. If they're claiming you've plagiarised a simple 'if' statement for instance, which you'll find thousands of similar examples of online, it would be safe to say you're colleague is overreacting. As a developer myself, I know that many of us will share habits of code structure, naming conventions etc. Small code pieces may look the same simply because we all know the most readable / efficient ways of writing them. If they continue to annoy you about it to the point it is harassing you and distracting you from your work, have a word with your manager. The way they'd probably see it; your colleague is making a mountain out of a molehill and demanding that you undo potentially hours of work.

If it's a more substantial piece of code and your colleague proves that it looks like the ripped source code of some other commercial program (just as an example), then you may have to speak to your manager anyway, in case there are any legal issues with the continued use of your code, even if the similarities are purely a coincidence.

The key in any case is to be calm and professional. After all, your company's reputation as well as your own is it risk if this surfaces later. In the latter case, explain to your manager that the similarities are coincidental, perhaps even suggest alternative approaches (though emphasise that extra time will be needed), and while not pointing the finger of blame at anyone, ask him if there are any legal concerns with its continued use.

  • I don't think it can be any simpler. Ask for proof. – camden_kid May 5 '17 at 9:37
  • From personal experience, I once had a colleague whose code was indistinguishable from mine. I noticed when I looked at some code and thought "I can't remember writing it", because it looked exactly like I would have written it, and it was no wonder I couldn't remember it because I didn't write it. If you had asked us to write code for the same task, the result would have been identical. – gnasher729 May 5 '17 at 15:20
7

Do not keep silent.

  1. Assuming these are intentional false accusations:

    • When you are confronted with that claim, directly:
      "You are talking nonsense. I did not copy. It you think so, prove it."

    • When you are confronted with that claim, indirectly (by your superior):
      "I don't know why they say that. I did not copy. Please ask them to stop spreading rumors, or prove it."

    • If you are not confrontated directly, but someone is talking behind your back, and you know who started the rumor, confront him:
      "I notice that you are spreading rumors about me copying code. You are gossipping behind my back. Prove it or shut up. If you keep spreading rumors I will take it to our superior."

    • If you are not confrontated directly, but someone is talking behind your back, and you don't know who started the rumor, you could say to both your colleagues and your superior:
      "I notice that someone is spreading rumors about me copying code. I don't know who it is, but he is gossiping behind my back. Either he proves it or shuts up.
      To your colleagues, add: "If this continues and I find out who it is I will take this higher up."

  2. [edit] As Dirkk commented, it could also be a misunderstanding.
    In that case, use milder language: "I don't know what you are talking about", or "Why do you think that?"

In both cases, you spend as little words on this as possible. You just state your position regarding the claim and make known that you will not tolerate false accusations.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.