11 Replies - 6730 Views - Last Post: 12 September 2008 - 01:09 PM

#1 akozlik  Icon User is offline

  • D.I.C Addict
  • member icon

Reputation: 90
  • View blog
  • Posts: 797
  • Joined: 25-February 08

Providing Code Samples to Employers

Post icon  Posted 10 September 2008 - 10:27 AM

Hey everyone. In the past I've been asked by a few prospective clients to provide code samples. I typically provide a few classes I've written and how they were integrated into whatever project they were from. I wanted to check the board though and see how you go about providing code samples. How much is enough, and what in particular are people looking for?

Thanks for some answers.
Is This A Good Question/Topic? 0
  • +

Replies To: Providing Code Samples to Employers

#2 tody4me  Icon User is offline

  • Banned
  • member icon

Reputation: 12
  • View blog
  • Posts: 1,398
  • Joined: 12-April 06

Re: Providing Code Samples to Employers

Posted 10 September 2008 - 10:28 AM

I normally put code samples between
tags like this 



Of course, I'm sure I'm not the only one, and not everyone that should does.

This post has been edited by tody4me: 10 September 2008 - 10:28 AM

Was This Post Helpful? 0
  • +
  • -

#3 girasquid  Icon User is offline

  • Barbarbar
  • member icon

Reputation: 108
  • View blog
  • Posts: 1,825
  • Joined: 03-October 06

Re: Providing Code Samples to Employers

Posted 10 September 2008 - 10:30 AM

There are small 64mb USB keys now that were clearly a "big thing" when USB storage was first coming around, and now retail for anywhere between $0.50 and $3. I tend to buy a handful of them whenever I'm someplace that sells them - I then format them, and load them up with:

- Resume
- Recommendation Letters
- Sample Code Folder

Underneath the sample code folder, I have code organized into categories based on language - beneath that, organized into projects. I tend to give the full source code to my projects - while a class might be interesting to see, the project in it's entirety is moreso(and lets the viewer get a grasp of more than just how well you can write classes). I also typically include a README file with the projects, with a brief summary of what the project was and any information that might be useful. Also, because the USB sticks are so cheap you can just give them away - I tend to include them in any face-to-face meetings I have with potential clients/employers.

This doesn't work quite as well in virtual situations - although I suppose that you could just package the whole thing in a .zip or something and send it off that way.

This post has been edited by girasquid: 10 September 2008 - 10:32 AM

Was This Post Helpful? 0
  • +
  • -

#4 akozlik  Icon User is offline

  • D.I.C Addict
  • member icon

Reputation: 90
  • View blog
  • Posts: 797
  • Joined: 25-February 08

Re: Providing Code Samples to Employers

Posted 10 September 2008 - 10:31 AM

So I think I wasn't clear. I wasn't talking about posting code to the board. I was talking about when you apply for a job, and an employer asks for code samples. What do you send them?

Edit Thanks girasquid, you knew what I was talking about

This post has been edited by akozlik: 10 September 2008 - 10:32 AM

Was This Post Helpful? 0
  • +
  • -

#5 Psionics  Icon User is offline

  • D.I.C Head
  • member icon

Reputation: 13
  • View blog
  • Posts: 158
  • Joined: 06-September 08

Re: Providing Code Samples to Employers

Posted 10 September 2008 - 04:13 PM

yea I agree with girasquid, I think that employers would like full programs, not just snippets or anything.

I think they want to look at both how code, but maybe more importantly how you organize that code
Was This Post Helpful? 0
  • +
  • -

#6 AdaHacker  Icon User is offline

  • Resident Curmudgeon

Reputation: 452
  • View blog
  • Posts: 811
  • Joined: 17-June 08

Re: Providing Code Samples to Employers

Posted 10 September 2008 - 07:13 PM

I work for a small company that runs several LAMP-based video/entertainment sites. We ask all developer candidates for code samples, and my colleagues and myself evaluate the code, so I've seen it from both sides.

Speaking as the person who reads the code samples, I do NOT want to see an entire large project. Don't be the guy who sent us an entire 30MB source tree, complete with Subversion files. I don't have 3 days to spend reviewing your code. If you send us that much, I'm not going to look at all of it, so just don't bother. What I want is a sampling of code that demonstrates that you know what you're doing. Just show me the best stuff you've got - pick something that showcases good design and clean it up to the best of your ability. If the best stuff you can muster doesn't impress me, sending a larger volume of lesser-quality code is only going to hurt your case.

From a PHP-specific point of view, here's what I look for in code samples we receive. Maybe it'll help give you an idea of what kind of samples to write. Note that we're looking for experienced developers - we're a small team with lots of projects, so we don't have time to train rookies.
1) Code that's clean, well organized, and appropriately commented. It should have a sane directory structure, classes and modules sensibly
decomposed, and so forth. PHPdoc comments are always encouraging, but not a necessity.
2) Solid understanding of object-oriented programming and design. If the code shows that you understand inheritance and polymorphism, that's a plus.
3) A basic understanding of design patterns, or at least separation of concerns. Using an MVC framework is good, but at the very least, domain objects, business logic, and markup should be separated. If you've got database queries mixed in whith your HTML, that's an automatic "no hire" in my book.
4) Use of current PHP programming idioms. If you're using $HTTP_POST_VARS or depend on register_globals or magic_quotes_gpc, that's a "no hire". It's also a bad sign if you use mysql instead of mysqli or pdo, but not necessarily a deal-breaker.
5) A basic awareness of security is a plus. Blatant SQL injection vulnerabilities are always a red flag.
6) A working knowledge a SQL is always good to see. It's not necessarily a problem is the code doesn't connect to a database, but if it does, I like to see something more than "SELECT * FROM foo" (assuming it's appropriate). It's a red flag if a candidate does multiple queries where a join would make more sense.
Was This Post Helpful? 1
  • +
  • -

#7 no2pencil  Icon User is online

  • Admiral Fancy Pants
  • member icon

Reputation: 5388
  • View blog
  • Posts: 27,384
  • Joined: 10-May 07

Re: Providing Code Samples to Employers

Posted 10 September 2008 - 07:30 PM

One time I took in print outs. What a n00b. I was like "Please sir may I have a job in C++?!". It didn't go over well.
Was This Post Helpful? 1
  • +
  • -

#8 Psionics  Icon User is offline

  • D.I.C Head
  • member icon

Reputation: 13
  • View blog
  • Posts: 158
  • Joined: 06-September 08

Re: Providing Code Samples to Employers

Posted 10 September 2008 - 11:01 PM

hahahahaha ^^ that's awesome! :)
Was This Post Helpful? 0
  • +
  • -

#9 Martyr2  Icon User is online

  • Programming Theoretician
  • member icon

Reputation: 4421
  • View blog
  • Posts: 12,286
  • Joined: 18-April 07

Re: Providing Code Samples to Employers

Posted 10 September 2008 - 11:09 PM

Typically I show a screenshot or two and then only the source code used to produce those screens. This typically includes a few features, a couple classes, enough to get an idea of my coding style and the type of documentation I would have for it.

:)
Was This Post Helpful? 0
  • +
  • -

#10 AmitTheInfinity  Icon User is offline

  • C Surfing ∞
  • member icon

Reputation: 119
  • View blog
  • Posts: 1,565
  • Joined: 25-January 07

Re: Providing Code Samples to Employers

Posted 11 September 2008 - 05:20 AM

I was supposed to complete the given assignment in 2 hours and then they reviewed my code [they asked me to submit even the rough papers I used to scribble while developing the solution!]. So from that experience, I think they just want to see our approach towards the problem and how efficiently we develop the solution; not the complete projects we did.

After all if we can do all projects by ourselves, why would we go to someone for job instead of opening our own company! :D
Was This Post Helpful? 0
  • +
  • -

#11 akozlik  Icon User is offline

  • D.I.C Addict
  • member icon

Reputation: 90
  • View blog
  • Posts: 797
  • Joined: 25-February 08

Re: Providing Code Samples to Employers

Posted 12 September 2008 - 11:44 AM

Thanks for all the suggestions you guys, very useful.

@AdaHacker - That was probably one of the most concise and helpful posts I've seen in a while. Thanks for pointing out exactly what you look for. That's the type of response I'm looking for.
Was This Post Helpful? 0
  • +
  • -

#12 AdaHacker  Icon User is offline

  • Resident Curmudgeon

Reputation: 452
  • View blog
  • Posts: 811
  • Joined: 17-June 08

Re: Providing Code Samples to Employers

Posted 12 September 2008 - 01:09 PM

View Postakozlik, on 12 Sep, 2008 - 01:44 PM, said:

@AdaHacker - That was probably one of the most concise and helpful posts I've seen in a while. Thanks for pointing out exactly what you look for. That's the type of response I'm looking for.

Well, thank you for the compliment. I'm just here to help.

Actually, I thought this was a very interesting question. I quite enjoy evaluating code samples from candidates. (The rest of my team isn't so crazy about it, though - that might be another factor to consider in writing your samples.) Not only is it interesting to see how other people do things, but it's a great way to see past resume inflation and simple incompetence. A candidate might have several years of experience in your programming language of choice, but still not really know what they're doing. You can't tell from the resume, but the code doesn't lie.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1