What does your code say about you?

Don’t look now, but someone is talking about you behind your back. They are spreading all kinds of ugly rumors about your work/programming abilities. I’m not talking about your best friend or even the guy you share an office with… I’m talking about your code.

We have been looking for another web application developer for the last couple of weeks. It has become painfully clear to me that programmers don’t pay enough attention to the code they submit to potential employers as examples of their work. When I’m sitting with a job candidate, I don’t really like to ask all that many technical questions because it doesn’t really prove much. If you answer the questions right, that says your book smart or you at least were prepared for the interview. But it doesn’t really say a whole lot about you as a programmer.

The thing that carries the most weight with me when it comes to fielding job candidates is their work/code samples. Your code: how it’s formatted, how it’s commented, the functions you use, etc. tells people a lot about you as a programmer. Lack of comments or formatting says that speed is more important to you than proper documentation or creating understandable code. Writing complex code that could easily be refactored by using a PHP function says that you may not have a proper understanding of the PHP language and the tools it provides.

Believe it or not, whether the code you submit actually works or does anything at all doesn’t matter to me in the least. Others may disagree with me on this point, but I don’t care if your code sample does anything. I’m not looking at whether your code works, I’m looking at formatting, logic, commenting, understandability, etc. I have interviewed people who come off very well in the face to face interview but when I look at their code they end up coming off like a whole other person.

Some people may think that I’m being a hard ass, but when working with other programmers being able to easily understand the code they write is essential to a successful project. If you’re unsure about what your code is saying to others check out some popular code standards (like those published by Zend or EllisLab) and see how well you match up. Also, don’t be shy to show your code to other developers you know to see what they think.

Take the initiative and find out what your code is saying behind your back.