views:

257

answers:

5

I'm currently working on my Bachelors dissertation. This involves developing a software product and a 12000 word write-up, mainly covering research, design and development. Now where I am quoting other peoples written work, I am obviously referencing this, but what about code? There have been plenty of times where I've looked for a solution to a problem I was unsure of and found someone who had solved the problem. Most of the time I took their code, worked to understand what they were doing, and then wrote my own version in my application, so should it be referenced somehow?

What would you guys do, put a comment in the code referencing the original author, add a reference in the write up or my bibliography, or nothing at all? Where its a significant or interesting piece of code used, I will probably refer to it in my write-up, but for solutions that don't warrant this, I’m trying to come up with a good solution.

If you were the author of some code I had either used, or been inspired by, what would make you happy that I wasn't plagiarizing you?

To take this a bit further, there's really 2 different things here. If I go to MSDN to lookup how to use a particular part of the .net framework, is that something that should be referenced, or is it fair use of the framework. Where as if I've used an algorithm that someone clearly developed and put a lot of time into, that's something I would definitely reference.

+4  A: 

It all depends on context. Many algorithms are so well known that they are generally considered public domain and as long as you reference a well known source on the subject then you shouldn't have any worries (Sorting, Searching)

When dealing with specific problems, especially in other people code, you have to read really carefully. If its published (book, journal, web, etc..) then you must always reference the original, at some point in your dissertation (technically once in then write up and then a comment in the source)

If it's other peoples work they deserve proper credit. Anything else is plagiarism

Jamie Lewis
You write really nice answers, mate.
Peter Perháč
+2  A: 

There's two aspects to this:

  1. The citation requirements of your academic institution. You should make sure you comply with this because if you're found to have plagiarised another's work you can be guilty of academic misconduct and you don't want that; and
  2. The ethics of using another's work. Barring "fair use" provisions (meaning there's only so much of someone's work you can reproduce before what you're doing is no longer "fair use") and the like, if you reproduce someone else's code, that you should credit. If you simply take the idea, that's possibly a bit different and is a judgement call. It depends on the significance of that idea and it's contribution to your work.
cletus
If you reproduce someone else's work, you should credit it, period. Fair use doesn't enter into it. It's simply the right thing to do.
Rob Kennedy
My comment on "fair use" was alluding to reproducing too much of it, not to giving credit. I'll clarify.
cletus
If i've used someone elses code, I'll credit it in the comments, every time, thats the right thing to do. My question was more about the academic context I guess, and how you would show this in academic work.
Sam Cogan
Sam, that's too specific a question to answer here. It depends on the policies of your institution. If yours is like mine was, you should have gotten a copy during orientation, and you probably got more copies when you first showed up to each class.
Rob Kennedy
Unfortunately while my institution is very specific with regards to referencing in written reports, when it comes to code they seem to be rather confused. Anyway, my idea here was just to get thoughts from people on the topic, so all these answers are great.
Sam Cogan
+1  A: 

Outside of academic work, I make it a habit to leave a comment in my source code if I reference someone else to solve a particular problem. It's for my benefit as well, I might want to go back and take another look at their code months later and have forgotten where I originally found it. Of course, take a look at the included license when you reference someone's code, it should be pretty clear what you can't do with it.

Marc Charbonneau
A: 

There's no shame in borrowing working code if it's the best tool for the job, provided the author's licence conditions allow it - real programmers do it all the time. But for academic purposes there is a problem if you could be percieved as being at all secretive or deceptive about it. To avoid that, I'd reference it both in the code with a big, clear comment, and in the report. Full disclosure means you can't be accused of doing anything wrong.

Marcus Downing
A: 

I have the same issue for my dissertation as well: I opt for referencing without overdoing it. Adding a reference to the referenced section, means that you've searched, found something, thought of using it and accepted it, while having nothing means that you made it up. This increases the value of your work in academical context (the more you base on previous work, the better). Also your supervisor will be able to trace license and algorithmic issues on the referenced site. At last you do not know where your work will get to. Suppose in 3 years after today someone tries to use it, and jumps into a patent violation? How can you help him - by a reference...

dimitris mistriotis