Ayende @ Rahien

Refunds available at head office

FAIL can impress, too

I mentioned that a quick way to setup things for me to think that a candidate is a bad idea is to send us a UI project. This is usually a very strong indication that the candidate doesn’t really have any idea what they are doing. They have been doing Win Forms projects, so they write the code for the task at hand in buttom1_Click event handler. Or inside the Page_Load code in an ASP.Net WebForms application if they are “web developers”.

On the other hand, here is a strong counter example. We had a candidate send in a WinForms project, as I said, that is usually a bad sign. But then I actually looked at his code:

image

And here is a single method:

image

This code is several levels of too complex for the task.  It can be easily simplified to a great degree quite easily.

But the key point from this, and the reason that this candidate has an interview later this week, is that this demonstrate a bunch of things:

  • Understanding of separation of concerns.
  • Code that actually does what it is supposed to do.
  • Proper integration between UI & backend code (for example, we are working with large files, so we have progress bars and off-the-UI-thread work).
  • The UI doesn’t look like it was put together by a hiccupping monkey.

I can work with this. There are things that need to be improved for what we do, but there appears to be a SOLID foundation here.

Comments

Jahmai Lay
01/29/2014 10:14 AM by
Jahmai Lay

It's not the point of the article, but that code screenshot is unreadable, even when zoomed.

Ayende Rahien
01/29/2014 10:16 AM by
Ayende Rahien

Jahmai, That is quite intentional.

hilton smith
01/29/2014 12:56 PM by
hilton smith

congrats to the candidate who will no doubt read this blog post. its official. you're not a "hiccupping monkey"...

:D

Brian
01/29/2014 05:40 PM by
Brian

Jahmai, That is quite intentional.

Sorry Oren, but I'm calling bullsh** on that answer.

Ayende Rahien
01/29/2014 05:44 PM by
Ayende Rahien

Brian, Well, fine. I am happy to be a fertilizer provider, in that case.

Brian
01/29/2014 08:46 PM by
Brian

:)

Bill Davis
01/29/2014 09:01 PM by
Bill Davis

I would be worried that you have a procedural programmer on your hands. Separation of concerns is great, but I wouldn't call that snippet SOLID. It's certainly breaking the SRP for the method in question; even without reading the code, there's no way that method has a single responsibility.

peter
01/29/2014 11:00 PM by
peter

@Jahmai I agree with Oren here. We have a rule-of-thumb in our group that any function that you have to scroll the screen to see the end of is too long.