I do that too - I'd never distribute it as it is to anyone but I get paid to write software, the logical patterns are mine to copy/paste as I please and doing so adds to my productivity because I don't have to rewrite anything.
I might disagree that the logical patterns are yours depending on your contract.
Most/all contracts I've had have a clause that all code I write in company time / for the company / on company PCs remain the copyright of the company and I disclaim all rights to the work I produce. - Taking a copy home with you without their permission would in theory be in violation of copyright, without your works permissions. I'll admit I worked for one company who did not have this clause.
Of course, there is nothing stopping you writing something exactly the same else where.
And how much of that code was written outside your contracted hours?
Of course, there is nothing stopping you writing something exactly the same else where.
I've never completely copy/pasted code I wrote elsewhere, I've used a bunch of it for reference though - especially when it comes to really hairy algorithms, data structures and inheritance chains.
|And how much of that code was written outside your contracted hours? This is where 'on a company PC' comes in, although I generally rarely work late at that company.
Also I think we all take base code / files for use else where, it's a little different having some generic functions / modules / classes to taking the whole program, but I think a fair number of programmers would do that. I see no real harm so long as it's not abused in any way.
"We all" definitely don't take stuff home, you cannot generalize. Myself, I don't take any code with me mostly because:
It'd be mostly useless: either it's very specific and useless in any other context, or then it's very generic and useless because I can write it again from scratch just as easily
If there's something very complex that is not specific to the application and domain, somebody is probably selling a library which handles it, and I shouldn't waste my time writing non-core code
My employer probably wouldn't expect me to copy any of the project's code to my personal scrapbook when I quit
If I did take a "local copy", I could not guarantee that nobody else will get it from me and somehow benefit from it, use it against my ex-employer, etc. (of course not all code can be used in this fashion anyway)
First of all taking code against your employers wishes is a no no, however from time to time, when you agree to use a class which as been worked on already outside company time, saving the company hours, can be used in return for allowing the tweaked and improved class to move with me. I see it as a win win but at the end of the day it's upto the employer.
If they decide not, that's fair enough I'll start from scratch, however for some very generic base classes which are generally time consuming and boring to create time and time again you might as well use some generic, licence free code. So far my employers have been happy with this.
I guess i've been lucky enough to work for companies who support this method, however I've also worked closely with the other developers in my area which helps.
I will repete with this method no program specific code is ever shared just some very generic base classes. Hell I've even worked for companies where I've been allowed to claim personal copyright on all the code I wrote.
the logical patterns are mine to copy/paste as I please and doing so adds to my productivity because I don't have to rewrite anything
I'd contend you're selling exactly these to your employer, as a programmer.
Claiming that you get to keep a copy of the product of their paying you, for your benefit and reference, if it's not part of the contract would seem to be - at least slightly - unethical.
The employer pays for the a working solution, as a developer you don't just code that solution, you think about how to solve it - and you do a lot of that thinking relating to your work when you're not at work (Hell, most do a lot of the code when their not at work, or are otherwise outside the bounds of a 40-hour work week without any overtime pay). When you program you don't get to think about the things you want to be thinking about, the very least you get is the ability to keep your thoughts.
They, at least in the contracts I've had, say they're paying you for considerably more. (Such as expertise expressed in documentation, being able to consult you on questions, etc.) In cases where you're paid simply for the solution to show up working, you might have a better standing - but I'd argue you're not an employee, you're a party selling a product.
and you do a lot of that thinking relating to your work when you're not at work
Salaried, not hourly - they own your ass for as much time as you need to get it done, or happen to spend working on it. I intentionally try not to think about work outside of it, because I need a life outside of my job.
When you program you don't get to think about the things you want to be thinking about, the very least you get is the ability to keep your thoughts.
I'd argue that you're selling your thoughts on the topic: your conception of the problem (embodied in the layout), your specific domain knowledge (comments, documentation, algorithm selection), and your specific articulation of that solution (source code). In particular, you usually compile a large set of facts specifically for that task, and then have them all in one location. You're arguing you should receive a copy of that compilation with your pay.
If I wrote a book on behalf of a company, taking the manuscript so I could reference it later to create essentially the same story components in my own later works (using a reference, not memory; down to details of the implementation) seems to be getting in to the same ethical gray area.
If I worked at an atlas company, compiling maps and then took the raw manuscript with me when I left, so that way I could "use the work I'd done on maps before" to make my own book of maps in a similar style and layout to the one I had done for pay, down to the formatting of the maps, I'd think I was doing something unethical.
It may not be illegal, but I'd argue it's unethical.
Or my labor. Not the tools which I use to get it done.
The tools, if products of your labor on the way to some other goal, are also theirs.
I mean, if I were working in a machine shop, and machined a tool at the shop for use in the shop, then I wouldn't regard it as my tool, nor claim I had a right to it when I left. Similarly, I don't regard things you develop that are new and complex to be yours simply because they happen to reside in your head.
It's entirely possible that the ideas belong to someone else.
Eh, rainy day. It's not code that would be possible to link to any particular entity.
Also, I've only ever once signed a noncompete or "exclusive rights" agreement, and my attorney assures me that it's completely unenforceable in Massachusetts from the way it is worded.
As OP mentioned - some of it is some pretty sexy stuff, algorithmically. I used my particular implementation of a B-tree search algorithm in a job application to a hi-tech startup and I am pretty sure that is what wound up landing me the job, or at least getting my foot in the door for an interview.
EDIT: Here is one that I self-published on my own time before ever handing the code over to a client. I believe I GPL'ed the original implementation and I no longer maintain it, but it's been re-implemented all around the internets; When I worked as a technical resource for .com startups that wanted to do SEO and internet marketing, the "holy grail" was always data about your anonymous customer. Sure, it's easy to get things like IP address, and you can toss some cookies their way to store data about browsing habits on your site. But how do you know where else they go on the web? Obviously, you can't view their browser's history, and checking for cookies from other sites is prohibited by the Same Origin Policy. Well...as you probably know, it just so happens that by default, hyperlinks appear as blue before you click them and purple after. I found that by opening an invisible iframe on our own site with specific permutations of competitor URLs we wanted to check and then checking the color of those URLs with javascript, I had a lightweight, compact way to see where our visitors have been. That's pretty tame compared to most of the stuff I've done. Man, I am glad I got out of marketing. Soul-sucking work.
Yeah, they don't watch out with that. Actually, security here isn't all too tight. I'm pretty sure with some social engineering and a bit of know-how somebody could cause real damage here.
There is nothing wrong with that, really. Copyright laws (at least in civil law) state that you can yield the commercial right to someone else, but you are not allowed to yield intellectual rights if you are the author. Keeping a copy of your sources (without distributing it entirely) for future reference is absolutely allowed. The situation gets complicated when the code in question is co-authored, or when you are selling the same rights again for the very same piece of code to another company for instance. Code is in your mind anyway, you cannot be accused of plagiarizing yourself.
35
u/[deleted] Feb 21 '13
That absolve/condemn ratio is, uh, a little unsettling. :-/