The Raven's Mutterings Wherein Carl Cravens talks about geeky stuff

27Jan/11

Can I infringe on copyright “from memory”?

My previous post brought up another interesting line of thought I've been mulling over lately. Magazine X publishes a photo spread of a pretty girl in a themed setting. (That the girl was mostly naked isn't important, but this is an actual case concerning a couple of "men's magazines," back in the '90's, IIRC.) Magazine Y sees that spread, thinks it's pretty nifty, and has their crew find their own pretty girl, build their own similarly themed set, and publish their own photo spread that looks much like the original, down to the poses and camera angles. The court ruled in favor of Magazine X... Magazine Y had intentionally infringed on their copyright by "reproducing" their artistic work, even though there was no mechanical "copying" involved.

Hm. Okay, so five years ago, I was working for Company B and I wrote a lot of utility code in the five years I was there. So I moved to Company E, and I quite wisely took none of the code I wrote for Company B with me because that would have been illegal. (Note: This is a fictionalized account of my career.) But here in Company E, I find that I need a script that backs up a server. I wrote one for Company B, but I can't legally reuse that code at Company E (if I had a copy of it), because the copyright for that code belongs to my former employer. So I decide to write that code from scratch. Yet... based on my personal coding style, form following function, and having actually written a solution for this exact problem once before, the code I write for E is very, very similar to that which I wrote for B.

Setting aside the unlikely event that anybody would realize that I did this, is that copyright infringement? In light of the photo infringement above, it seems to me that this is basically the same thing. I recalled the copyrighted work that someone else owns and attempted to reproduce it, claiming ownership of the reproduction for my new employer.

I think this happens on a practical basis regularly in computing, but we don't really think about it. Yet I think, technically, it's a violation of copyright. Imagine a world in which a software developer not only had to deal with "non-compete clauses", but had to deal with not being able to reproduce any code he has written in the past for another employer. That would certainly "break" the development world. Previously, I mentioned that I feel like a lot of my utilities and code snippets are the embodiment of my programming knowledge... this is the converse (inverse?) situation. When I write that backup script, I'm not copying a previous work, I'm embodying my knowledge in physical form. Is there really a difference between my writing a shell-script menu loop from memory and copying that menu loop from a library snippet? I don't think so... except the latter is faster and less error-prone, therefore more pleasant for me as well as cost-effective.

I consider programming to be capable of "artistic expression". A good programmer recognizes and delights in elegant code and elegant solutions. But I'm not convinced that all code should be subject to copyright in the way that fiction, non-fiction, music, etc should be. At a basic level, we have a "useful article" issue... the pattern for a basic kitchen chair is not subject to copyright, because a chair is a functional article, a "useful object", and copyright does not allow for protection of function, only expression.

There is only one way to write a Bash for-loop. The variable name can change, the data looped over can change, and the steps between the top and bottom of the loop can change... but the basic structure of how a for-loop works is fixed. Nobody can claim copyright over it. At what point does your "useful article" for-loop quit being "common" and become a protected "expression"? This starts to feel more like patent territory than copyright... at what point is a program innovative enough that it's not unintentionally reproducing hundreds of other programs written in the same situations? When is it not just a "dump" of programming knowledge but an actual novel creation?

26Jan/11

Who owns my code?

As a *NIX systems administrator, I write a lot of utility code. Backup scripts, configuration scripts, that kind of thing. I run my own personal Linux servers and workstations at home, and because I work and play in very similar computing environments, much of what I do at work applies to what I do at home and vice versa. I learn how to configure my mail server to handle multiple domains at home and apply that knowledge at work. I learn how to set up DNS at work and apply that knowledge at home. (In fact, I have so many different domains at "home," my home setup is often more complicated than work... sometimes I think there's an imbalance between things learned on the job and things learned on my own time, and it leans in work's favor.)

But in the course of doing all of this, I inevitably write code in one place that I have a use for in the other. Case in point, I have a bunch of remote backup scripts I wrote to backup my server and all my workstations to local disk, keeping N days worth of changes, etc. I worked out the whole scheme on my own time, have tested it extensively on my own systems and have been using it for over a year. When I needed to back up my new work laptop in the same way (because it's the only machine I have at work now and it's never on the "work" network when the backups run), the obvious solution was to just copy over the software I'd already written, tested, debugged and proven. It's a much more robust solution than the quick-and-dirty backup another admin wrote to back up our webserver. (That one isn't backing up the MySQL database properly. I need to convert it over to my script.)

So ownership here is easy... I wrote it on my own time, it's mine. I can slap my copyright on it and license it for my company's use out of the goodness of my heart. (My annoyance at reinventing a wheel I already invented saves the company money. I could justifiably rewrite that code from scratch on company time, as there's no obligation to give the company the fruits of my personal labors for free.)

But what about the other way around? What if I wrote that backup software on company time? Traditionally, that's work-for-hire and is owned by the company. Being that our company lacks any specific agreements to the contrary, that's is the legal situation where I work (unwritten, informal agreements don't really count in copyright court). Yet, to the seasoned developer's mind, it doesn't make sense to look at the work I've done and have to recreate it from scratch in order to use it from home. Culturally... do developers pay attention to copyright law and the employer's ownership of their code for little utilities? My experience is that they don't.

I think this also works out in the employer's favor... an experienced developer doesn't just take with them code they wrote on the job when they leave, they bring with them all of their favorite little utilities that they've written on past jobs, that they wrote in school, that they wrote on their hobby projects. And often, when they move on, they leave copies behind. The tech support guys use a script I initially wrote over ten years ago when I worked for an ISP. It doesn't look much like the original script, but it has ten years of improvements on it. I wrote it because I needed it, but I've used it at every company I've worked for and passed the current copy on to others in my department. When I move into a new job, I bring with me a whole library of tools that make my job easier, and often make others' jobs easier.

The irony is that if we strictly followed copyright law, treating work-for-hire code as something I can't take with me, and treating any code I wrote on my own time my property and unusable at the company (without paying me a licensing fee), I think the computing world would be in a world of hurt. I'd feel crippled every time I moved to a new employer. (Much like I felt at Company B, when they told me Emacs was not approved software and I'd have to use the "original" vi.) Taking the time to recreate some of my basic tools would be a stupid waste of time... my previous employer would not benefit from it, and I would suffer for it, and I would be less valuable to my new employer.

I see writing these utilities as a lot like learning a new programming language or learning how to manage Sendmail... the employer can't stop me from taking that knowledge to my next employer. And part of that "knowledge," in my mind, is embedded in the code I've written. Quite literally... I have a whole folder full of snippets that I reuse, or use to remind myself how to do something. To me, those are "mine" in the sense that my knowledge of Perl and Unix are "mine".

12Jan/11

I’ve fallen down a mineshaft and can’t get up!

Recently I started playing Minecraft… a game that has sold nearly 1,000,000 "pre-orders" and won PC Gamer "Game of the Year" while it was still in Alpha test stage. (It only recently entered Beta and is scheduled for "release" late 2011.) It's a game about exploring a 3D world while breaking and building stuff with the blocks the world is made of.

I had played Minecraft Classic with my son on a multiplayer server ("multiplayer" = the two of us), and while it was pretty fun for awhile, I tired of it after only a couple of weeks. It was pure exploration and building. After awhile, the exploration got dull… it's a neat, randomly generated world, but it's all scenery. There's nothing to do but break up the scenery and build stuff. Once you've dug down to the bedrock (the lower boundary of the world), built a tower to the cloud ceiling with your infinite supply of blocks, found (and swam in) lava, and flooded a cave with infinitely-multiplying water, there's not much else to explore. You can find some neat "natural" caves, but those tire after awhile because they're just scenery. If you don't like building structures with a digital form of LEGO bricks (except you never run out or have trouble finding that one brick you need), there's not much else to do.

So I didn't have much interest in the newer, pay-for version. It had minecarts and track, and apparently had monsters, but that didn't sound like it was worth spending $15 to get more of what I'd already grown bored with. But my son insisted that he needed to try the new version (confusingly known as Minecraft Alpha, but now it's Minecraft Beta, etc… I guess the names are properly "Minecraft Classic" and "Minecraft") and spent nearly three weeks allowance on it after Christmas. And since he was playing it, I bought it and set up a multiplayer server to play with him again.

Wow… what a difference a few little changes make. First, you have no infinite supply of building material. You start the game on a beach, empty handed. It's just past dawn, and there's a day/night cycle that lasts only twenty minutes. That means you have only ten minutes before the sun starts to set… and when it gets dark, monsters come out. And it gets really dark. And empty-handed, you're no match for all the monsters that are going to come pouring down on your head. (They aren't called "mobs" for nothing.)

So the first order of business is to build a monster-proof shelter, and ideally get a light-source so you don't have to wait out the ten minutes of night in idle darkness. That means chopping down a tree and forming it into planks with your bare hands! Then you just need to build yourself a workbench, craft a wooden pickaxe, and go mine some coal to make torches. All before it gets dark.

The fruitless search for coal has led to many an adventurer's early demise. But that's okay, you'll be reborn on the beach where you started. In the dark. Surrounded by monsters. You're not going to do anything useful until morning, and you might as well get used to dying now.

Fortunately, when the sun comes out, half the monster types catch fire in the rays of the sun. The other half are a pain in the butt. One sneaks up on you and explodes. Took me a week of play to learn to recognize the sounds it makes when approaching… it sounds a lot like the player walking on dirt, and I thought those noises were me, or were noises the spider made while walking around. Nope, that's the Creeper, and he is my bane and nemesis. Especially because he likes to explode near my shelter and blow up the cool stuff I've built and make me waste time filling in holes in my defensive wall. Bah.

So there I've covered all the changes that turned a ho-hum "not quite a game" into something I can't tear myself away from. Day/night cycle, with night being dangerous, means you can't just build, build, build outdoors for hours. If you want to build an impressive stone bridge across the bay, you're doing it ten minutes at a time, keeping one eye on the sun and one eye watching for Creepers that have managed to survive. Forced to retreat to the safety of shelter for the night, you mine for limited resources… coal, iron, gold, diamonds. But you have to keep an eye out for the natural caves… monsters spawn in darkness, so it's likely that any caves you find will be full of monsters. So you craft weapons and armor out of the resources you've collected, including a bow and arrows made from the silk of giant spiders you've slain, in close combat I might add.

The game still doesn't quite have a goal yet… it's not finished. (Nearly a million sales and multiple awards and it's not even finished.) But even so, I find creating simple shelter and then turning it into a fortress, then a "livable home" (mine has a sun room, a sheltered patio with fire pits, and I'm working on building a swimming pool with underwater lighting), while searching for limited resources, exploring caves and fighting off monsters rather compelling.

It's fun in multi-player. You deal with supply shortages, have to coordinate activities ("We're short on pickaxes, you go chop some wood while I mine this iron ore."), explore caves ("Wow, check this out, I think it goes down forever. Hey, don't push me!"), and fight monsters together ("Lookout, Zombie!"). Or my son runs away from monsters while I fight them. Except Creepers. We both run from Creepers and fill them full of arrows from a distance.

Good times, man. Good times.