03 December 2009

You can't have a gut the size of mine and then go ignoring its warnings...

I interviewed a guy about 10 months back who we've since hired. Having now worked with him on a project, I realize I should have listened to that little voice. Here's the email I sent to my architect after finishing the interview:

Interview went pretty well. He’s a nice guy and I think he’d fit in with the team really well. That said, I’ve got a reservation or two.

He wrote *the single strangest* factorial I’ve ever seen anyone write. Other than a couple of small bugs with it which I helped him see and work through, he had this...well, let me see if I can reproduce it:

public int factorial(int x) {
  int[] arr = new int[x];
  for (int y = x; y > 0; --y) {
    arr[y-1] = y;
  }

  int value = 1;
  for (int x; x > 0; --x) {
    value *= arr[x - 1];
  }

  return value;
}

I think that’s it, after we fixed his bugs. It took a while for me to get him to figure out he didn’t need that array. Afterward, we were talking and he said he tends to think of solutions to problems with loops and arrays and that’s just where his mind naturally gravitates. That is one big hammer he carries around and it concerns me.

He was open and listened clearly and didn’t *ever* get defensive about what he’d written, but it still gave me pause. He knows what he knows, wants to keep learning more, and would fit in great on a team. But...
Yeah. I should have paid more heed to that little voice.

0 comments: