Get Rid of Source Code Templates
hackerboss.com
hackerboss.com
It may be ridiculous for that author but it's quite important.
1. What license it's released under. 2. Who you can contact to get permission to use it.
If there's really no way to tell who the author is or what license it's under, then I'd say not to use it. It's probably better in the long run that way anyhow.
It also raises the cost of factoring code out into its own file. Even a simple code header can easily be double the amount of code I consider worth extracting.
I know many IDEs add them automatically, so it doesn't feel like much of a cost to the writer, but as the reader, you pay it every time. Why waste brain power thinking "Ok, ignore everything above, this down here is the real source code"?
(That said, I totally agree with you. I wouldn't use them at all if I wasn't forced to at work.)
If you're running a large project with thousands of files license changes can be automated with some trivial amount of coding, so this isn't a major issue. In large projects the license terms don't change very often anyway.
These templates are written for a reason. Some companies DO write templates to make their files "standard". This is nothing new especially in a corporate environment.
So if I see a file lying somewhere around the internet, how do I tell who owns the copyright? How can I tell when it expires?
And if I find an executable, say, lying around in a coffee shop, how do I tell who it belongs to?
The berne deal doesn't require you to label these things, but without them, how can someone else tell?
How common that is might vary in different programming languages. It's quite common to share Javascript code by just swapping standalone .js files, and it's not uncommon in the Lisp world either.
# foo.py: objects that manage the interaction between foos and bars
# (see eof for license and detailed description)My Perl template is:
use MooseX::Declare;
class $classname {
}
My Haskell template is: module $module where
If you need anything more complicated than that, it's time to write code to fix the problem, rather than have your editor type the same text again and again and again and again.The "templates" the article is talking about are large boilerplate comment blocks at the top of source code files, with license, attribution, changelog, etc. information. Nothing about executable code.
"This means that you don’t need to do anything to have copyright over your works."
But you DO need a copyright notice to collect damages for infringement. Without a notice, the most you can get is an injunction to stop infringement.
"Often, source code files repeat the file name in the file itself."
So you can tell which file when printing, or when viewing through a broken web interface.
Really? I would need some kind of source for that claim.
Figlet output. Yay!