Programmers’ copyrights never expire

Our copyrights never expire! Because our copyright notices are programs that ensure that they never will:

<div>
  Copyright ©
 
  <span x-text="new Date().getFullYear()"></span>
</div>

🤣

Funny joke right?

Except it’s not a joke. At least I don’t see alpine.js laughing. This fragment is in the example code shown on their website and it doesn’t look like they think it’s a joke. And I have seen code exactly like this, that will use code to show the current year in the copyright notice, all over the place. In real codebases. Of commercial websites, web apps and in cloud platforms.

This is of course complete nonsense, completely wrong and bordering on illegal.

Copyrights DO expire. The law does not care about the copyright notice. It’s there just as a reminder. And the year in the copyright is traditionally there BECAUSE copyrights expire. It’s supposed to tell us when the work was created, so we can work out if the work is still under copyright or not.

But of course, if we just always put in the current year, as soon as one year has passed, we are just lying. The work was not created that year.

Don’t let the software lie to the user. Never. Ever.

If it were up to me that would be in an ethical code for programmers somewhere.

Either manually maintain a hardcoded year, or use some build task to flll in the current year when you build a new version, or just omit the year altogether, but do NOT write code like this. Please.

Do you have code like this in your codebase? Leave a comment below.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s