News for hackers. Stuff that matters.

Ask HN: Sample of code ?

Some job ads mention to provide a sample of code. I find it extremely hard to provide a sample of code that would represent how I work. (I'm a web developper). When trying to find an example, I was always unable to dig out something without giving 130 pages worth of code...

How would you do that ? What do you show when asked ? What is working ?

( 4 comments | 4 points | on HN )
Re:Ask HN: Sample of code ? by rchiniquy on Thursday January 29, 2009 @05:17PM (#457237)
Code is not always requested just for the purpose of representing the applicant. Sometimes interviewers (like me) just want to have code to hand which you are guaranteed to be familiar with; It's nicer to reference code you've actually written to ask specific questions about, say, stack vs heap usage or OO design.
Re:Ask HN: Sample of code ? by cperciva on Thursday January 29, 2009 @04:19PM (#457145)
"Here's my website, go look at some of the open source code I've published" tends to work well. The more code you throw at people the better -- that way it's clear that you're not hiding a large volume of garbage while showing them a few good lines of code.
Re:Ask HN: Sample of code ? by defunkt on Thursday January 29, 2009 @04:34PM (#457169)
This is where contributing to open source really comes in handy. For one of my earlier jobs I was unable to show any code from previous employers but had a project on SourceForge. From what I heard, it helped land me the job.
Re:Ask HN: Sample of code ? by suhail on Thursday January 29, 2009 @04:25PM (#457151)
Perhaps you can just say "here's something I've built, completely by me."--I don't seen how a few lines of code is going to say much, writing neat code is like comp sci. 101.