12

I'm a student and won't be publishing code any time soon, but I am working on improving the composition of my code. I'm interested in open source and I've only seen copyright notices and license text at the very beginning of files.

If I place the copyright later in the file, say, after the synopsis, or even at the end of the file, would someone misusing my code be able to get away with saying: "Oh, well you're supposed to put the copyright at the beginning, its not fair to expect me to go looking around for it".

Textbooks also put copyrights before the table of contents, which I think is weird because if I was looking in a book for specific information (the copyright), the first place I would look would be the table of contents, to see which page to turn to, but then it isn't always listed.

Basically, are there any hard rules about where I'm allowed/not allowed to place copyright notices and other legal info?

Edit:

I actually really like all the answers, but this paragraph in David Schwartz's answer tells me what I feel like my brain should have realized before asking the question in the first place:

Rights separated by copyright law include making copies, distributing to the public, performing in public, making creative follow on works, and so on. These are things you always need the copyright holder's permission to do and if you can't get it for any reason, you simply can't do those things.

  • What do you mean by "misusing" your code? – David Schwartz May 21 at 18:45
2

If I place the copyright later in the file, say, after the synopsis, or even at the end of the file, would someone misusing my code be able to get away with saying: "Oh, well you're supposed to put the copyright at the beginning, its not fair to expect me to go looking around for it".

Either the person "misusing" your code is doing something they are allowed to do under copyright law or they are doing something they need the copyright holder's permission to do under copyright law.

A copyright notice can't take away any rights anyone already has. A book can't have a copyright notice that says, "By the way, you may not read this book on Sundays". A mere notice can't take away anyone's rights.

So if they're doing something they don't need special permission to do under copyright law, then that's the end of it. It doesn't matter what the copyright notice says if you're doing something copyright law allows you to do anyway.

But what if they're doing something they're not allowed to do under copyright law without permission of the copyright holder? Then how would them saying they didn't see the copyright notice change anything? They would just be admitting that they had no reason to think they had a license or other permission to do something that the law requires them to get permission to do.

The structure of copyright law is as follows: Normally, if you own something, you can pretty much do whatever you want with it. Without copyright law, if I owned a book, I could read it, copy it, perform it in public, or otherwise do pretty much anything except throw it at someone else's head.

Copyright law changes this. Copyright law sets aside specific things that are not rights of possession. It separates the physical possession of a book from the right to make copies of the creative contents of that book. The things that copyright law separates from rights of possession then become things you need the copyright holder's permission to do, regardless of your physical possession of copies of a work.

Anything not separated from rights of possession by copyright law are rights that anyone who legally possesses the work may exercise. For examples, US law does not separate use. So anyone who lawfully possesses a copyrighted work may use it in the ordinary way. So you don't need permission to read a book you own or watch a DVD you own.

Rights separated by copyright law include making copies, distributing to the public, performing in public, making creative follow on works, and so on. These are things you always need the copyright holder's permission to do and if you can't get it for any reason, you simply can't do those things.

Copyright notices really only do two things:

  1. They inform people who the copyright holder is. This can be helpful if you're trying to contact the copyright holder to get additional rights.

  2. They can offer additional rights that you wouldn't otherwise have. For example, a copyright notice can include permission to make copies or permission to perform the work in public.

But that's about it. Copyright notices are not required and they cannot take any rights away. Nobody is under any obligation to read them or consider them if they don't want to. They are not binding on anyone but the person who wrote the notice.

21

Under the Berne Convention, a copyright notice is not required at all, although using one is good practice. Using one usually eliminates the claimed status of "innocent infringement", which, if found true by a court, greatly reduces damage awards.

It is usual to place such notices at or near the start of a work. That is where people tend to look for them, and I don't see any good reason not to follow this practice. The book tradition is the the copyright page comes before any part of the actual work, including the table of contents, sometimes with a continuation at the end of the work, if there is more than one page of notices. But that is not now a legal requirement, if it ever was.

In short, there are no rigid rules on this, but putting a copyright notice at or quite near the start is good practice, and I would suggest sticking to it.

  • 1
    In addition, other comments (such as Javadoc or Doxygen) come at the front of the class, so putting other metadata there as well makes sense. – chrylis -on strike- May 21 at 17:27
  • "I don't see any good reason not to follow this practice. " Because its a waste of space and a distraction in every single file. Its common practice to put the license in a file named license.txt on the root directory of the project. – Qwertie May 22 at 1:10
  • @Qwertie I didn't say the license, I said the copyright notice. Still a license.txt file is all too easily separated from the project, often accidentally. When I write code, as i do every day, every file has a copyright notice at the front, plus one displayed usually under an "about" menu of some sort. Not legally required, but a good idea. But you can do as you choose, and so can the OP and anyone who reads this. – David Siegel May 22 at 3:14
1

Not a lawyer, but I did spent 3 minutes in a law school building asking directions once. Oh, and a big advocate for F/OSS software.

I do not think there is a requirement for the license to be at the top. However, that is the expected location, and an accepted convention. As you probably know, most IDEs can be configured to insert a default block of text at the top of the file just for author/copyright/license info.

The GNU folk on their "How to use" page at https://www.gnu.org/licenses/gpl-howto.en.html give a few good points as to why it should be included in each and every file, and several of those reasons lead to why it is best to have it at the top of the file. I'd recommend reading over the entire document, as well as the linked documents at the top that may help you pick the appropriate version of the GPL for your needs and wants.

However, programmers often copy source files from one free program into another. If a source file contains no statement about what its license is, then moving it into another context eliminates all trace of that point. This invites confusion and error.

Programmers also often start at the top of the file to get any required includes/imports, etc. and then chop out whatever methods/functions they want to move over - with your copyright notice and license info at the top, it is quite clear and the next developer won't accidentally leave it out, etc.

1

I recall reading that the legal disclaimer of warranty/liability (THIS SOFTWARE IS PROVIDED "AS-IS" ...) should be placed prominently (including being upper case) to maximise the chance of standing up in court. Perhaps someone could confirm this. Certainly the "GPL How-To" makes it very clear that the licence should be at the top of the file. At any rate it makes sense to put the copyright notice in the same place.

Due to the nature of open-source it is common for individual files to be copied into other projects and so having a file's copyright holders and licence terms within each file is good practice.

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.