I have been on the other side of this -- I've asked a candidate for a code sample, and received obviously proprietary code in response. In fact, it was proprietary code that was very closely related to what my company was working on. Consider this from my point of view: by sending that code to me, the candidate was exposing me personally to a lawsuit from his previous employer! At the very least, it forces me to be much more cautious about how I implement that same feature for our system.

In this case, I felt that the candidate was being unprofessional (I highly doubt he was being malicious). He simply didn't think through the ramifications of his actions. I also blame myself, because it's an easy mistake for a candidate to make and I should have been very explicit when I made the request in the first place.

That said, it's also easy to take this too far. If everyone were to go by the strict legal interpretation, then very few people would have anything other than silly class projects for code samples. (I see very few CPAN authors applying for our open positions. /msg me and ask for a job if you want to prove me wrong!) The way I see it, I spend enough extra time working that I can ethically claim that some portion of the code I write for my job really belongs to me, and I am simply giving my company unlimited free reuse rights. That of course does not apply to anything directly related to what my company does. But I don't really care if I used company resources to develop the code; I develop plenty of code for my company without using its resources, and I'm only talking about stuff that's never going to hurt them to reveal. I'm sure that I have no legal ground to stand on, but I will always follow ethical rules over legal ones when I can get away with it.

I'd also think that the OP's interviewer was being neither idiotic nor malicious. His expectation was not an unreasonable one given his personal experiences. It was just mildly dumb and flat-out wrong. The OP told him his opinion of the situation, and it was both reasonable and legally correct. "Maybe so, but I still want you to break the law for me" is not an appropriate response.

Oh, and if you're looking for a job and haven't previously squandered away a stash of sample code, then you'd better sit down and write something. If I were the interviewer, I won't accept the lack of any non-proprietary code as an excuse to not provide a sample at all. But I'll be fine if you write something new, especially if you explain to me that you did that because you didn't have anything legally available. (Or just anything that you weren't too embarrassed to show.) I don't care if it ends up with way more comments and much more thought in it than a realistic code sample would. Those things are easily noticed, and I always interpret code samples more as what the candidate things good code should look like rather than what they actually write day to day. I can still get a good handle on the candidate's maturity of expression. (Imagine reading an essay written by someone who has only taken three years of English lessons. No matter how long they spent on it, you'll be able to gauge the level of sophistication. Unless they cheat using a fluent speaker.)


In reply to Re^2: Code Samples and Previous Employers by sfink
in thread Code Samples and Previous Employers by friedo

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.