If the plagiarized code is commented out because I found another way to solve the problem, but I forgot to remove the comments, is that considered plagiarism?
I used the copied code to help me debug and compare the output between my own code and the copied code. In the final code, I commented out the copied code. Since comments don’t affect how the code runs, can comments be considered plagiarism?
2
-
School: They like you doing your own work. Even if the code isn’t used, it being there might be enough to get you in trouble based on the teacher/school
-
Work: Dead Code/Commented out Code can and has gotten people in trouble before in lawsuit cases (assuming the code was conflicting with someone’s proprietary code).
- If it’s under most of the creative commons licenses, MIT licensing, BSD, etc… from the owners standpoint you should be good. Assuming you’re following the license on usage (making the software free, only using for academic purposes, etc)
My gut feeling would be this:
Remove the code you’re not using, it’s good practice anyway (it adds nothing to the understanding of your live code), dump it into a “dead” file so that you still have all of the code, but don’t have it in your distributed code. Or better yet, if you’re using a version control system, just remove the code and do a commit, you’ve got your commit history so you’ll always have the code.
The real world doesn’t have “plagiarism,” it has “copyright infringement.”
Plagiarism is a matter for passing others’ ideas off as your own. It’s not illegal, and for the most part nobody cares. In school, where your ideas determine your grades, plagiarism is a capital sin because it muddies up academic evaluation. But in business the ability to incorporate others’ ideas into your own work is a marketable skill.
But in business there’s also copyright infringement, which is the violation of a state-granted monopoly on the reproduction of one’s work. If you have license to copy, then no harm done as long as you work within the granted license. Otherwise, you best remove the infringing content.
Note that in the academic world of “plagiarism,” copying the idea is the offense, not necessarily the content. Rewriting someone else’s work into your own words doesn’t make the ideas your own, so the plagiarism is not avoided.
But in the business world of “copyright infringement”, the copyright exists on the specific implementation, not the idea. Re-implementing a given mechanism in your own clean code (not simply transcribed; you need a “clean-room” implantation to be thoroughly safe) is enough to make the code “yours”, and not copied.
1
If you use code from elsewhere, always make sure that you keep track of where you got it from, e.g. keep the URL next to the code you copied or even better, really state that some part of that code came from that source.
Plagiarism is the “wrongful appropriation” and “purloining and publication” of another author’s “language, thoughts, ideas, or expressions,” and the representation of them as one’s own original work. So if you put a clear reference, it will not be plagiarism.
However, that doesn’t put you in the clear: copyright (or licensing) may still be an issue. If the original code doesn’t state a license, it is not safe to use it in production. IANAL, but I wouldn’t worry too much about putting a piece of code for which there is no explicit license in the comments if you have your equivalent implementation that is clearly different (e.g. not just renaming all variables or porting to a different language).
If the original code has some kind of license, you will have to consult that to make a judgement call and abide by the license.
If this is for school work, then it really depends on the agreements you have with your teacher/school (e.g. honor codes). As a TA myself, I prefer students to be honest and write where they’ve got some parts of their solution (even if those sources happen to be other students). If only a minor part of their result is their own work, then they have a problem.
Its plagiarism if you claim the copied code is your own work. But schools and businesses often prefer to have a bright line around what you wrote. If I copy (retyping, cutting and pasting, etc.) something that someone else wrote, remove their name, put in my name as ‘author’, and tell people I wrote it, that’s plagiarism.
Its not like fair use or licensing. If I copy “main(int argc, char *argv[])” from a text book or web site, its not plagiarism unless I claim I invented it. If I implement DVD encryption/decryption or JPEG compression/decompression and give appropriate credit, its not plagiarism, but I’m still in trouble, because I’m not LICENSED to have them. Even if I envented it syself in a clean, white room.
If I put someone else’s implementation of something inside my code to compare my version with their theirs, not indicating what I wrote and what I copied, that’s ambiguous. If I have a comment that reads, “Compare to my code” then I’m clearly not claiming authorship, its not plagiarism. If someone asks me and I say, “that’s a solution I found in a book, on the internet, etc”, that’s not plagiarism. Whether or not its in comments or live.
Plagiarism is knowingly copying someone else’s work and claiming that its yours.
I hope that helps.
Bill