Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

I read this Gawker article about how a writer reused some of his older material for new assignments for different magazines.

Is there any similar ethical (societal?) dilemma when doing the same thing in the realm of Programming? Does reusing a shared library you've accumulated over the years amount to self-plagarizm?

What I'm getting at is that it seems that the creative world of software development isn't as stringent regarding self-plagarism as say journalism or blogging. In fact on one of my interviews at GS I was asked what kind of libraries I've developed over the years, implying that me getting the job would entail co-licensing helpful portions of code to that company.

Are there any cases where although it's legal to self-plagarize, it would be frowned upon in the software world?

share|improve this question
2  
Even in other fields self-plagiarizing is not so bed. Some very good books were grown from series of articles or conference papers of the author that have already been published. –  Vitalij Zadneprovskij Jun 19 '12 at 22:03
2  
Battle-scarred and debugged code represents quite a bit of value. Why not reuse? –  user1249 Jun 19 '12 at 22:14
1  
It really depends on who owns the copyright on the duplicated material. If you were employed to write the code by a company, they may well own the copyright and you should not be copying it to another company. –  Jaydee Jun 20 '12 at 14:32
1  
Have you ever heard of DRY? –  Baboon Jun 20 '12 at 15:13
    
@ThorbjørnRavnAndersen: reuse is OK, but not copy-paste. Obviously if you developed something at company A and they didn't give you ownership or licensed it for reuse, then you cannot directly reuse that at company B. You are free to re-implement it (as long as it's not patented), but the implementation should not be identical (which rarely is the case when you actually re-write something without looking it over, speaking from experience as a teacher after having seen hundreds of re-implementations of fib() and factorial() and other things, and still spotting plagiarism in it easily...) –  haylem Jun 20 '12 at 16:53
show 2 more comments

4 Answers

up vote 14 down vote accepted

I've never heard of it being called "self-plagiarizing" in the software world. It's called "reusable libraries". In journalism, there may be an expectation that a writer will submit and publish new articles, as that is what they are paid to do. A software developer may be expected to help produce new software but if they use pre-existing libraries that they wrote before, that's not so bad. It helps move the project faster, and it prevents you from having to re-invent the wheel.

At the same time, if I had a truly awesome library of reusable components I'd built up over the years, I'm not sure I'd ever give them to an employer to use in their project if the licensing might mean I'd never be able to use them again for any other projects in the future.

As an employer, would I trust some new developer who has a great big library of awesome stuff if I can't get full access and control of the source code? I might be willing to buy pre-built libraries from vendors with support contracts.

And to be honest, I don't even think the comparison to journalists and writers is appropriate. It just doesn't make sense. One of only things these two activities have in common is the verb "writing".

share|improve this answer
1  
Maybe a better analogy would be an architect recycling architectural plans for different houses. The cases where it is unacceptable are similar (e.g., it often is not OK to re-use graphics, even if you have permission). –  Brian Jun 19 '12 at 21:59
2  
@Brian: I am not an expert but I have heard this is actually quite common. I had a friend whose parents had a "custom" built home which was really looking over plans the architect had done before until they found one they were mostly happy with and then having the architect tweaking it until it was "just right". –  FrustratedWithFormsDesigner Jun 19 '12 at 22:01
    
Yes, I had that knowledge in mind when I made the comparison. –  Brian Jun 19 '12 at 22:02
    
@FrustratedWithFormsDesigner What you describe is cheaper then having the architect start from scratch. If you are expecting and paying for 100% custom, and you get a design from a library you would be very upset. –  mhoran_psprep Jun 19 '12 at 22:04
    
@mhoran_psprep: I suppose. I've never worked with an architect but I imagine that even if I paid and expected 100% custom work, there would still be some common components and designs, probably for infrastructure issues such as plumbing, electrical wiring, ventilation , etc... And that would be OK by me because I don't expect the architect to design new types of air ducts for a custom home, just because I said I want "custom". I guess if we really wanted we could argue whether those "came from a library" or maybe the analogy isn't a perfect fit... –  FrustratedWithFormsDesigner Jun 20 '12 at 14:21
add comment

The issue isn't who wrote the code, but who owns the code. If you were paid to write some code for one employer and then re-used that same code (without permission) on a job for someone else, that's a problem unless you somehow retained the rights to the code. In the US, at least, that's not how it usually works -- the guy who paid you to write the code owns it.

The main difference I see between writers and programmers in this regard is that if an author writes new material that expresses essentially the same ideas, the right thing to do is to at least credit the first version with a line like: As I wrote previously in The Popperville Gazette.... It'd be unusual to do that in code, though... as long as the previous work isn't patented (as opposed to copyrighted), you should be able to re-implement the idea in new code without necessarily needing to credit the first work.

share|improve this answer
    
Right - the question is who holds the copyright. For journalists, that often means the newspaper or magazine that published the piece. For programmers, that often means your employer (see the "work for hire" clause in your employment agreement) or the client (ibid.) unless your contract makes it clear that you own it. Whomever owns the copyright has the right to use it. If you don't, then you don't. Legally or ethically. If you do, then you do. –  Ross Patterson Jun 20 '12 at 23:39
    
plagiarism has nothing to do with ownership, plagiarism is about the readers of your code. –  paul23 Jan 31 at 14:33
add comment

If you have the right to reuse code, or use a library, I can't see how that would be frowned upon. Unless they wanted you to develop the code from scratch.

Why would they want that?

  • to take advantage of updated technology.
  • to have a library of code with hooks in place for expansion.
  • to have the source code.

If they were paying you the hours to rewrite the code, but you use the same libraries, they will feel that they over paid.

share|improve this answer
add comment

Self-plagiarizing (by Joshua Bloch) below code has been officially considered copyright violation:

private static void rangeCheck(int arrayLen, int fromIndex, int toIndex) {
    if (fromIndex > toIndex)
        throw new IllegalArgumentException("fromIndex(" + fromIndex +
                   ") > toIndex(" + toIndex+")");
    if (fromIndex < 0)
        throw new ArrayIndexOutOfBoundsException(fromIndex);
    if (toIndex > arrayLen)
        throw new ArrayIndexOutOfBoundsException(toIndex);
}

But as long as one self-plagiarizes within the same company, it's likely legally OK.

Self-plagiarizing is also OK ethically, as long as it does not fall into violation of DRY.

share|improve this answer
    
While I don't have it at the tip of my fingers, there was an instance of a photographer violating copyright (work for hire) because he took a similar photograph to one he had taken before (same model though years later, same pose, same location). –  MichaelT Jun 19 '12 at 22:30
2  
Terrible example. Yes, a jury reached a partial verdict that Google infringed, but the judge later ruled in Google's favor, stating, "the particular elements replicated by Google were free for all to use under the Copyright Act." –  Sean Jun 20 '12 at 3:02
    
I wouldn't say DRY has anything to with ethics. Lack of competence, skill, and knowledge to grossly violate it...yes. Nothing unethical about it unless you do it on purpose hoping it will cause hell for future maintainers. –  Rig Jun 20 '12 at 14:27
    
@Sean whatever the ruling is today, or will be tomorrow or ten years after, I would think twice before concsiously copying code I wrote for another company (and to avoid misunderstanding - no, this is not about rangeCheck, I don't think Bloch copied it from jdk/src) –  gnat Jun 20 '12 at 14:28
1  
+1 the example is irrelevant; the point on how the author may not be the copyright owner is very relevant. –  André Paramés Jun 20 '12 at 15:31
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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