Many books on computer programming publish source code listings and example programs as part of the printed book to demonstrate some aspect of the language. When I'm learning from such books, I typically copy one or more examples from the book into my computer in order to run them, study them, run them using a debugger, etc. I copy the version from the printed book and do not use any other included media such as CD-ROMs or Web sites. I had always assumed this sort of copying for personal use on my own computer would not be considered copyright infringement, but now I'm not so sure.

Sometimes, the book does mention an implied license near the beginning that clarifies how the source code can be used. In this case, the license normally allows copying for the sort of purpose I'm talking about. But in the large majority of cases, there is no license mentioned at all pertaining to how the source code included in the book may be used. If there are electronic media provided with the book (CD-ROM, Web site, etc.), the electronic versions of the source code typically do mention a license, but I do not typically make use of such media, so for the purpose of this question I want to ignore them.

In one unusual example, there is a well-known programming book that explicitly forbids any personal use of the source code in the book on a computer without first obtaining a license:

You must read this section if you intend to use the code in this book on a computer [...]. Without the license [...] this book is intended as a text and reference book, for reading and study purposes only.

It then goes on to clarify the granted personal use license:

If you personally keyboard no more than 10 routines from this book into your computer, then we authorize you (and only you) to use those routines (and only those routines) on that single computer.

However, I cannot accept this license due to the restrictions. For example, I may want to keyboard more than 10 routines. And I may want to use some method of copying other than to "personally keyboard" them (e.g. automatic dictation software).

My questions:

  1. For the case that a book does not include a license that mentions copying the source code from the book version, is it allowed for the reader to make personal copies of the source code to run on one's own computer?

  2. For the case that a book does include a license, but that license is found to be unacceptable by the reader, is it allowed for the reader to make the personal copies? Does the fact that there is a license offer that the reader does not agree to make any legal difference as compared with case 1 (no license offered at all)?

Assume that the source code to be copied would normally qualify for copyright protection (i.e. do not consider trivial source code examples that by themselves may not be eligible for copyright), and that the reader either owns or is borrowing (e.g. from a lending library) a legal copy of the book.

  • 2
    I don't want to repeat what has already been written here. (In short, judgement of fair use is a 4-factor case-by-case analysis, and we wouldn't be able to tell you definitively whether the use in your question is fair use. Non-profit educational use is one of the example purposes, but that doesn't short-cut consideration of the other three factors.) Is there anything that other answer doesn't answer for you?
    – user3851
    Aug 23, 2016 at 16:47
  • 1
    I might go a little bit further, and say that the question "is this fair use?" cannot be answered here. The reason is that fair use is a highly subjective analysis, and I believe that the only people qualified to say whether a fair use defense is likely to succeed in a particular context are IP attorneys advising clients. For us to say that X would or would not be fair use skates perilously close to giving legal advice.
    – user6726
    Aug 23, 2016 at 17:20
  • @user6726 "subjective" is a poor choice of words, legal decisions are always based on objective criteria: they are never subjective. Fair use is definitely "nuanced", "arguable" and "case-specific", it is not, however, "subjective".
    – Dale M
    Aug 23, 2016 at 22:53
  • My question is not "is this fair use?" Instead I want to know about the legal status of the copying in these 2 cases. For example, perhaps the answer is, "no, neither case is infringement", or perhaps "case 1 is not infringement because there is an implicit license, but case 2 is infringement due to the explicit license that you rejected", or perhaps "both cases are infringement, because you have no legal right to copy the source code for personal use without a license specifically permitting that."
    – Brandin
    Aug 23, 2016 at 23:19
  • @DaleM, I believe "subjective" is exactly correct. The jury subjectively determines how the 4 factors are "balanced", and the law does not say anything about how they could possibly reach an objective decision based on the law.
    – user6726
    Aug 23, 2016 at 23:51

1 Answer 1


Ignoring fair use, copying code in which copyright subsists would be copyright infringement.

... the owner of copyright under this title has the exclusive rights [...] to reproduce the copyrighted work (17 USC 106)

Code is eligible for copyright as a literary work.

Copyright protection subsists [...] in original works of authorship fixed in any tangible medium of expression [...] Works of authorship include [...] literary works [...] (17 USC 102)

Oracle v Google. (Fed. Cir. 2014):

It is undisputed that computer programs— defined in the Copyright Act as a set of statements or instructions to be used directly or indirectly in a computer in order to bring about a certain result, 17 U.S.C. § 101—can be subject to copyright protection as literary works.

One way that copying the code would not be infringement is under a scenes a faire or merger analysis. In some circuits (e.g. 6th Circuit), scenes a faire/merger can preclude copyrightability. In other circuits (e.g. 2nd and 9th Circuits), these apply as affirmative defences after an initial finding of infringement. In either case, just as in fair use, this would be a case-by-case analysis, so we can't provide a blanket answer.

  • Thank you for the answer. But I'm still interested in the licensing issue. For example, sometmies an author/publisher includes a license that says personal copying is permitted, but usually there is no license mentioned. In a few books I've seen, there is no license as such, but the author makes a statement such as "Type in and test the following code on your system." Would a statement such as that qualify as a license to copy the portion he is referring to (on my own system, for the purpose of testing, etc.)?
    – Brandin
    Aug 24, 2016 at 14:37
  • @Brandin If they tell you to do something with the code, that is an implied licence to do that thing. However, that might not even be necessary, because of fair use, but you asked this question to not be about that. So you are getting answers to possibly irrelevant issues.
    – user3851
    Aug 24, 2016 at 14:41

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.