So, it happened again. I'm looking at a perfectly reasonable resume. The interests line up with what we're doing. The skill set seems to match our needs. The coder has a nice attitude. And I ask for a code sample. And...
TRASH CAN!
Next resume. College students and industry veterans, I've seen them both do it. Just send something which is so incredibly horrible that I can't even make an excuse for it.
In some other professions, like journalism or design, you have a portfolio. You'd never even consider putting anything but your best foot forward in your portfolio because you understand, this is part of your resume.
But for some reason, many programmers seem to think of the coding sample as a burden, or something which just proves they can actually write code (as opposed to writing good code). But as far as I'm concerned, your code sample is every bit as important as your resume.
My code sample checklist
Here are some things I look for.
- How quickly can I understand the overall structure of your code? Code is a means of communication, and if it's not well structured and organized, there's a problem.
- Is it a mickey-mouse project? Save me from yet another implementation of binary heaps. It doesn't need to be grand, but it's gotta show effort. If not, it makes me wonder how much code you've actually written. Even if your professional code is all proprietary, did you really never write anything just for yourself, or your kids, or have a little GitHub project? How many hours did you spend on your resume? Did you seriously not want to spend that many again on a decent code sample?
- If it's a school project, then I am not your TA. Code which performed correctly and passed the automatic assignment checker isn't good enough.
- The basic stuff...descriptive and accurate naming, consistent style, appropriate comments. If you couldn't be bothered to consistently indent your code when you're trying to get your foot in the door, what makes you think I'm letting you touch my code base?
- Bugs. Some people compile code. I usually don't. But I do read it. And I am pretty good at spotting bugs. And if I spot bugs in yours, we've got problems.
- Did you clean up after yourself? I look at a lot of code in C++, and I expect to see memory freed and objects deleted.
- Are you doing common-sense error-handling? My code requires bullet-proof error-handling; if you don't step up to the plate even a little with your code, I just don't have confidence in you.
- Are you abusing the language?
So you think you're an expert
I do sometimes hire people with knowledge gaps. Bringing in somebody who needs some training but shows growth potential might be a great investment for the future. But that only works when the applicant has an appropriate level of humility.
Here's some code I received from a "C++ expert":
if (month == 1) str = "January";
else if (month == 2) str = "February";
else if (month == 3) str = "March";
// etc.
Maybe if the fellow hadn't billed himself as an expert, I might not consider him a lost cause.
Why does it matter?
Probably some of the code samples I receive are from people who can do much better. But in good code, attention to things like detail, consistency, and the communicative qualities of the code are really important. I like people who obsess over those things even when they just don't seem that important, because they're much more likely to do them when they are important.
Tell me a story
Code always tells me a story. If the code is good, it'll be a fun story for me, and you can bet we'll hash it out in the interview. But if the story your code tells me is "I don't care", there won't be an interview.