Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

What do you do when you don't have any good code samples available when asked by a prospective employer? I like to consider myself a fairly capable developer but I can't share any of the software I've been writing for my company the last few years.

Unfortunately, I haven't been able to find the time to put much work in my personal projects either. Basically, I don't think I can find any code samples that are a good representative of my skills that I can share. Any ideas?

Thanks in advance.

share|improve this question
    
possible duplicate of What sources of sample work should be used in a job interview? –  gnat May 30 '13 at 6:25
add comment

4 Answers

up vote 19 down vote accepted

If you can't share your employers code, and you have no personal code then you have two options, inform your prospective employer that you can't oblige them, or write a small project.

Your best bet would be to try to spend a weekend making a small application that uses a few common patterns, is TDD, and is built to the highest quality you can achieve. Perhaps a domain shortener or some such.

Presumably the employer doesn't want to trawl through thousands of lines of code, but is looking to see tests, well named methods and classes, and a general lack of spaghetti coding.

share|improve this answer
3  
This was going to be my answer. In short, you need to make time to produce some sample code. –  Pete Jun 26 '11 at 18:09
    
So, I want to start using GitHub, but for some reason I do not want others to see my progress. I only want to check in something that is pretty much complete. My reasons: my free time is scarce, and so there might be 2-3 months when I am too busy to make any changes. Whoever views my history would notice that. Am I too paranoid? –  Job Jun 26 '11 at 18:14
    
Are Github repositories always public? I haven't used Github. In general, just make the repository private and only send people the latest code when they ask for a sample. –  jhocking Jun 26 '11 at 18:32
1  
@jhocking: Free Github repositories are always public but you can pay for private ones. –  Tikhon Jelvis Jun 26 '11 at 22:50
    
If the project is in a usable state, then I think it is totally acceptable not to have any changes in a longer stretch of time. –  Simon Richter Jun 27 '11 at 7:40
show 1 more comment

For this particular employer, explain that you don't have any code samples and explain why, then offer to write some code for them as a test. Ask them what they would like you to program.

For the long term, prepare some code samples. The question's going to come up (not every time, but a lot) so be ready for it.

share|improve this answer
add comment

I agree with another answer, that you need to find time to write some code.

Another approach that requires less time in a row than writing a project is to do a series of catas and put them on a website (or flash drive you bring with you.) Catas are short and easy to do. If you spend 15-30 minutes a day, you'll have a bunch of code in a week or two.

How do you get to be a great musician? It helps to know the theory, and to understand the mechanics of your instrument. It helps to have talent. But ultimately, greatness comes from practicing; applying the theory over and over again, using feedback to get better every time.

How do you get to be an All-Star sports person? Obviously fitness and talent help. But the great athletes spend hours and hours every day, practicing.

But in the software industry we take developers trained in the theory and throw them straight in to the deep-end, working on a project. It’s like taking a group of fit kids and telling them that they have four quarters to beat the Redskins (hey, we manage by objectives, right?). In software we do our practicing on the job, and that’s why we make mistakes on the job. We need to find ways of splitting the practice from the profession. We need practice sessions...

share|improve this answer
add comment

Short answer : you need to do a side project.

Longer answer : pick something you want to do in current job. Can then show it to future employers as it's a prototype. It could be shown to current job if you think it'll earn some brownie points.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.