I know your code is copyrighted.

I'm not an expert in US Copyright law, but I do know that you don't have to register a copyright to have one. All you have to do is make some utterance on your behalf or someone else's and it's owned. Write code in a file - it's owned.

Why, then, do we have copyright notices in file headers? If you want evidence of plagiarism or illicit copying, you can diff files. Court cases have turned on that sort of evidence. No, it seems that a copyright notice in a file is a warning. And, at the very least, it does indicate an owner - it tells you whose file it is. But.. why do the notices have to be so long?

Source file headers bother me, not in principle, but because people rarely know when to stop. First you have the copyright notice, then you have the disclaimers of liability, and if you are really unfortunate, you have 50 to 1000 lines of version control comments. You know, that's what we have version control systems for - to keep all of that history. There isn't much value in keeping it in the code. It's not like a file is going to wander down to the corner on its own. Code lives in an eco-system. I dare anyone to take a random file from a "enterprise" project and attempt to use it independently. It just doesn't work like that.

For better or worse, files are seen as the smallest independently distributable units in software. I suppose that if you are a lawyer, you take notice of that fact and make the file the unit of diligence. You want the notice there so that it is plain and in the face of the the potential abuser. And, if a legal notice is small, that's fine. One line, two lines.. I can handle that. The thing that I want an alternative to is the mandatory page down on open that is part and parcel of most source code. It's a tax. It is (to draw an analogy) as if every car manufacturer put a reverse etched liability disclaimer in the windshields of cars - something that you as a driver can't avoid every time you sit down in the car.

Do we really need that? I don't think so, but I do know that in most organizations, no one wants to be the one who trimmed back the mandatory header. It's just too easy to avoid that decision.. it's too easy to not be he person who said "You know, I think we can make do with a single line copyright statement and a url to our legal notices." It's such a small inconsequential issue.. unless you're a programmer.

If you're a programmer you scroll, and scroll, and scroll.

Note: this blog was inspired by a hard-edged code review done by a few years ago at a client site by "Uncle Bob" Martin.