Chinaunix首页 | 论坛 | 博客
  • 博客访问: 417663
  • 博文数量: 73
  • 博客积分: 3326
  • 博客等级: 中校
  • 技术积分: 631
  • 用 户 组: 普通用户
  • 注册时间: 2010-02-05 15:31
文章分类

全部博文(73)

文章存档

2014年(1)

2011年(51)

2010年(21)

分类: IT职场

2011-08-31 13:03:07

That’s the challenge.

Sit down with someone you’ve never met and try to work out if they are a coder or a clown.

I don’t mean to insult anyone, of course, and I’m the first to acknowledge the years of training and effort that goes into being a professional clown.

But some coders, oh boy.

Like the time I interviewed a recent graduate. I’ll call her Ada. Full of sympathy for the novice programmer I started with a gentle warm-up, a soft-ball question to break the ice.

I asked Ada to write some code, on paper, that would print the word “hello” ten times. Any programming language would be fine, I said.

Here’s what Ada wrote.

On the positive side there were no spelling mistakes.

This is where I risk upsetting some clowns masquerading as coders. I had expected some awareness of basic looping structures. Is that too much to ask, do you think?

No, I don’t either.

Some people collect stamps. I collect examples of dodgy code. I pick them up from code reviews, and I’ve been blessed with many years of good harvesting. I collect them mainly for fun, but they’re awfully handy for interviews too.

I might pick ten examples for an interview, most usually in C# and TSQL, and ask the candidate what they think of them.

Actually, I’ve done this often enough to develop a bit of a patter, something like this:

I’m going to show you some code. All these examples were found in real code reviews, and in every case the code was ready for release to real customers. You can assume that it compiles, has been tested, and works according to the spec. What I’m looking for are issues that would concern a maintenance programmer.

The Syntax Clown

So let’s say I pull out a code sample like this

1
2
if(long.TryParse(x, out number))
    number = long.Parse(x);

In case you’re wondering, I’m hoping coders will spot that the second line is wholly redundant. But the Syntax Clown will immediately point out the variables x and number haven’t been declared.

“Remember”, I say, “this is just an extract from a larger body of code, we know it compiles and has been tested.” Then I will pause, optimistically.

The Syntax Clown inevitably replies “but you haven’t declared the variables!

“Tell me the variables aren’t declared again, I dare you.
Tell me one more goddamn time.”

 

The Everything’s Rosie Clown

If the Syntax Clown is guilty of not listening, the Everything’s Rosie Clown is more guilty.

Rosie refuses to believe there’s anything wrong with the code, even after I’ve effectively said “here is some crap code, see if you can spot it!”  Clearly bad code does not exist in the magical fantasy world where Rosie lives.

“There’s no such thing as badly written code,
and besides that, just look at my lovely hair!”

 

The “I definitely know, but I just can’t explain it” Clown

With a firm tap on the paper and a sage nod of the head it is obvious this clown knows exactly what’s wrong with the code.

But right this minute they just can’t find the right words to explain it.

And they can’t find the words even if you give them a minute. Not even if you wait all day.

If you waited until the end of time their skeleton would be sitting and nodding wisely but still at a loss for words.

Despite their insight and instinctive trouble-shooting ability, these clowns just can’t get the words out. It’s a shame.

“Wait! I know this one!
Now, how can I dumb it down for them…”

 

Rube Goldberg Clown

This clown is fascinating. They will never write a simple loop when they can write an iterater. They will never simply iterate when they can recurse. If you wanted to scoop an , these are the clowns for you.

“This code obviously lacks an abstract-proxy-façade.”

 

Angry Clown

Many times I’ve been greeted politely, had a pleasant conversation about the weather, made some tea and settled in for a good chat about programming.

Then all hell breaks loose.

Angry Clowns are cool, calm, and collected, right up to the point where you ask the first question.

“How the F**K should I know,
that’s a stupid F*****G question”

 

It’s not all that bad

To be fair, if someone interviewed me they might think I was a clown, maybe a few of these clowns mixed together. That’s the interviewer’s prerogative.

What’s more, some coders might think they’ve been interviewed by the . That’s their prerogative.

Whatever the outcome, dear programmer, know that I’ve tried to build a rapport. Sometimes it’s just hard.

Funny though.

()

阅读(2335) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~