Coder or Clown?

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

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 obfuscation contest, 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 Ringling Brothers. 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.




Posted in Hiring, Interviewing
49 comments on “Coder or Clown?
  1. slawek says:

    People might get nervous, but yeah… maikng mistakes being interviewed is unfortunate 😛

    But… interview is a fun when you win, but when you loses it appears as a stinky waste of time

    Conclusion – chill out ;>

  2. T800 says:

    As short as It gets (VC6-style):

    for(int i=0; i<10; i++, printf("hello"));

    Do I qualify 😉 ?

    • mr foo says:

      This is shorter (javascript, using global variable declaration


    • nod2fint says:

      respect. you sir qualify as a clown! be proud of it..

    • Tom says:

      Yes! Your code qualifies for the bad code sample part of the interview!

    • svella says:

      It can be done shorter:
      for(int i=10;i–;cout<<"hello")

      and although the problem statement didn't explicitly call for it, usually you would want each hello on a separate line, which could be done in the same number of characters using puts() instead of cout<<.

  3. jkricka says:

    Pulp fiction reference made my day!

  4. Ian R says:

    Ada just optimised her code using loop unwinding ( !

  5. igguk says:

    print “the word hello ten times”

    Definitely not a Rube Goldberg clown 😉

  6. Tim says:

    Shorter than Ruby’s

    10.times { print “hellon” }


  7. RK says:

    Wouldn’t the code Ida gave work best? In a loop of printing the same thing over and over, wouldn’t you loose efficiency in the assembly jumps… a good compiler would just unroll this anyway, right?

    • RK says:

      “unroll this” meaning “Unroll a loop if that is how you coded it”

    • RK says:

      Loved the Pulp Fiction reference.

      …and the Angry Clown. Have one on my team… every time they don’t understand something either the “developer made it overcomplicated” or “it’s retarded that it has to be done that way.”

  8. TedvG says:

    Ah. Actually, what Ada did (what’s in a name)
    was cool..

    Ada’s program was:
    -completely bugfree!
    -very efficient! (no loops, loop vars, no stack etc,)
    -easy for the maintenance department!
    -perfectly readable!
    And then, you’ve asked for a hard coded FIXED (10) number of prints!

  9. Brandon says:

    TSQL –

    GO 10

  10. Kurt says:

    And in the end it doesn’t even matter, because you can’t even define what you want. Most managers are so removed from the programming process, they don’t even know what they’re talking about. I don’t know of a single manager that wouldn’t fail miserably under a microscope. That being said, I actually like your simple examples, but there’s a lot to keep in mind. In your example, it may not matter if an interviewer knows what that means. Most programmers do what they know and move on, so probably only know one of those ways to parse. Is that wrong?

    I know programmers that sound sophisticated, and it’s all crap, because their design will never work. The worst programmer I’ve ever seen had 2 masters degrees. The cockiest programmer that I’ve ever seen had 1 masters degree, and was always right, just ask him. Fed up with his mouth one day, I told him to put money where his mouth is. I tried to bet him a $100 that I could code twice as fast as he could, and my code would run faster. His best friend could come up with the task to code. He declined, and that was the last time I had to hear about all of his God like qualities.

    I think that you could probably skip the interviews , and hire based on the number of programming languages they have used. Be sure to include microprocessor programming.

    So who am I? The cleanup crew. Somebody has to have a good understanding…

    • Paul says:

      You can’t ever skip the interview. Many of the clowns I have seen are experts in C++, Java, .NET (according to their CVs). But they can’t show us how to sort a list of ten numbers, in any language like they like, using something really simple like a bubble sort.

  11. Really says:

    I can’t believe you think recursion is for clowns.

    Tail Recursion is much more elegant than trying to write a loop. (For specific cases and not all).
    Are you educated? Do you understand the fundamentals of computer science and applied mathematics or did you learn to code from one of those 24 days books?

    • e says:

      actually, they said nothing negative against recursion… only that there is something wrong with forcing a shoehorn recursion solution in when a “simple loop would do” all likely in the attempt to save 15 clock cycles and 13.5 jump instructions.

      or just to see if they can. is this wrong? I don’t have an opinion one way or another, but from a software engineers point of view, you don’t want more than one or two of these guys in a team or you will never get anything code complete.

    • Me says:

      Recursion is slow.
      And more unnatural.
      You must wipe your ass as natural as can be, otherwise, too much recursion..

    • Jake Jake says:

      You are sounding a bit like the angry clown!

  12. PR says:

    @Tedvg perfect example of Everything’s Rosie Clown
    Most annoying type while interviewing, one of them was hell bent on convincing me that for upto 50 related variables there is no need to use arrays, as u can declare that many variables without getting tired.

  13. nickels says:

    If you spent more time trying to suss out people’s strengths and figure out what they are excited and good at you would probably run into a lot more talent than you do giving people inane (banal) little toy problems that try to trip them up.
    Let me guess, you interview for google?

  14. LazyGuy says:

    I’d be lazy enough to do this (Python 2):
    print “hellon”*10,

  15. Shawn Mclean says:

    There are actually coders like this out there and I bet many of them even get the job…and I cant get any… 🙁 It sucks to be a programmer living in Jamaica.

  16. TedvG says:

    hihi. it was also meant as humor, you didn’t notice that? :o)
    I am having some fun. I’ve been programming since 1978
    in modern and classic programming languages
    In all these years I had to go through many often silly) but also constructive interviews.

  17. Paul Gehrman says:

    The interviewers are usually the clowns, but of course, interviewing effectively is very difficult, so it’s easy to be a clown. I’ve always found that professional references always tell a much better story and I can usually get the information I need from references if I probe deeply enough. Asking someone to explain how to implement a singleton or explain polymorphism is a waste of time, as is asking them to code something. I think one of the best indicators of how good someone will be (especially at the senior dev level) is asking them more philosophical questions such as what they think of ORM. Their answer will speak volumes about how they view the inevitable tradeoffs that we make daily in our code. You’ll also be more likely to uncover an OO astronaut and save yourself the inevitable headaches that come from having to refactoring this person’s code.

    Finally, good pulp fiction reference. I’ll have to rememeber that the next time I’m in an interview.

  18. If I don’t pick on any of those clowns, whom will I hire???

    I guess most would be programmers will be a part of the clowns your describing. My question is who would be fit to be a “would be better programmer” if I hire one of those clowns.

  19. Jim de Graff says:

    Shortest version in APL

    10 shape enclose ‘hello’

    but you have to replace ‘shape’ with the Greek letter rho and the word ‘enclose’ with the symbol that looks like the letter u rotated 90 degrees clockwise. That leaves you with an expression that is 11 characters long.

    Shortest version in Python is also 11 characters

    10*”hello ”

    but igguk’s version (print “the word hello ten times”) is my favourite response.

  20. sakamoto says:

    Ok. I gotta disagree with you guys. Perhaps I am just being contrary 🙂

    const string hello = "hello"
    var numTimes = 10
    RepeatMessage(numTimes, hello);

    public void RepeatMessage(int numTimes, string text){
    for(int i = 0; i < numTimes; i++){

    From a maintainability standpoint, that code is straightforward and encourages reuse. Separating the data from the method allows the method to move elsewhere, etc. I realize the example was trivial, but I would take the opportunity to demonstrate that I know how to write maintainable, extendable code that is not overly complex. Maybe, I'm all wet…


  21. You’ve got a typo on the line that begins, “Actually, I’ve done this often enough to develop a bit of a [pattern].”

  22. I think this does a good job pointing out the dichotomy between what interviewers want and what academia is producing. People who can produce working tested software vs people that might be able how to tell you how it ought to be done.

    Knowing all the theory and buzzwords will only get you so far.

    I like the idea of testing the applicant’s ability to refactor code. I think adding a debugging test would be good as well.

    I agree with an earlier commenter that the ability to write code in multiple languages can be a good indicator of a good developer (for now). Interviewees have a tendency to game the system. This may or may not be related to the fact that all the postings I see for programmers start with, “Must have 5 years experience.” Not terribly sure I want to hire someone who took 5 years to figure out how to write an Asp.Net app.

    Thanks for making me laugh. The captions were great.

  23. Dan Sutton says:

    Funny: when I interview programmers, I sort of know instantly if they’re going to be any good — has something to do with the way they carry themselves – the right mixture of arrogance and superiority complex — the really good ones recognize each other instantly, the way vampires are supposed to do…

  24. Dan Sutton, that is so very aptly said: “I sort of know instantly if they’re going to be any good — has something to do with the way they carry themselves – the right mixture of arrogance and superiority complex — the really good ones recognize each other instantly, the way vampires are supposed to do…”

  25. J B says:

    Great test but as an employer myself the most you want from an employee is honesty, and after that adaptability. Where in your silly tests do you ask for that? Your “print Hello ten times” test is meaningless. It is a question that no one would ever have done or use, so Ada may have thought what is this person after, probably a bit nervous, so answered it how she thought you may want it. For you to make the conclusion that that Ada doesn’t understand looping is in itself loopy. Lastly have you done any statistical modelling yourself? I would warrant that you have never employed an “Ada” (ie someone you did NOT like in the interview) to test whether your employment theory works. There is no statistical reasoning behind your theory. Who is the clown? Have a look at yourself.

    • Bob says:

      I’m guessing you fall into the clown category – usually one finds that people who know their stuff don’t mind having to prove it. If you can’t prove it, you ain’t worth your paycheck. 🙂

      • J B says:

        I agree to allow people to show their worth is good, but does setting a silly test prove anything? Einstein failed to get into Zurich University at his first attempt. He couldn’t prove he was the world’s greatest physicist in a test and that presumably contained sensible questions. Einstein proved, among other things, that tests have very limited reliability.

  26. Being a “Rube Goldberg clown” myself, and inspired by Tim’s and sakamoto’s comments, how about (C#):

    10.Repeat(() => Console.WriteLine(“Hello”));

    public static class IntExtensions
    public static int Repeat(this int count, Action repeatAction)
    Enumerable.Range(1, count).ToList().ForEach(n => repeatAction());

    return count;

  27. cagdas says:

    I have not met a rosie yet and nothing as ridiculous as the loop retard but I’ve definitely seen the others. I think the most dangerous is the rube goldbergs. And the ones that pass the interview and do not write any code because “there is always something wrong: requirements are not defined, the API is lacking a feature, etc”

  28. Pwistu says:

    everything should be made as simple as possible..but not simpler. – Einstein

  29. lonepsycho says:

    clowns or not clowns… clowns do earn some extra cash for circus, or don’t they?

  30. Another Voice says:

    C# guys != coders

  31. Someone in nowhere says:


    And let’s just say that it’s a method call for printing out “hello” x10.

    By the way, there are 2 other clowns:
    1) The “EnglishIsGreatSoUseItOverallClown”:
    He would write something like:
    int thisIsMyVeryGoodCounterVariableWhichIsGoingToBeUsedInTheExample = 0;
    int thisIsTheMaximumCounterVariableWhichIsGoingToBeUsedInTheExampleToo = 10)
    string thisIsMyVeryFantasticStringVariableWhichFinallyPrintsOutTheWord_Hello_WeAreLookingFor

    for( thisIsMyVeryGoodCounterVariableWhichIsGoingToBeUsedInTheExample < thisIsTheMaximumCounterVariableWhichIsGoingToBeUsedInTheExampleToo; thisIsMyVeryGoodCounterVariableWhichIsGoingToBeUsedInTheExample++ )

    2) The 488rs Rul3Z clown:
    If he had to write a mathematical code, it would look like this:

    private int yyZZyzYYzZZyYzYCalcAddMdfrZyZ()
    int yyZ = 582, ZyZ = 998, YYz = 3, ZZy = 15, YzY = 80;

    int YYY = yyZ(ZZy-YzY)+YYz*ZZy*YzY/-((-(-(ZyZ(ZyZ-ZZy)yyZ)-yyZ)yyZ)ZyZ)

    return ZZy*YYY

    So noone in the world would understand what the hell this method does…even the clown wouldn't know 2 minutes after finishing the code.

  32. Rosie the Riveter says:

    Is it fully redundant? If I had walked in cold and didn’t know what any of the variable were or what you were trying to accomplish with this code, and not having someone tell me there is a serious problem, I would suspect that the “tryParse” attempted to perform the parsing action but didn’t fail in the event that parsing was not viable, and if it didn’t fail, THEN it performed the actual parse. That type of test is not really that uncommon. If it were COMPLETELY redundant, it would say “tryParse” again. So I guess that makes me the “Rosie” coder. It would be interesting to know what percentage of the people you asked had my view of this code. You left out the people who think they are smarter than everyone else, and them makes up names for them.

  33. Rosie the Riveter says:

    Ok – I wrote my prior comment before I drank enough coffee. What I was trying to say got confused. Here is what I was trying to say;

    (from msdn)
    The TryParse method is like the Parse method, except the TryParse method does not throw an exception if the conversion fails. It eliminates the need to use exception handling to test for a FormatException in the event that s is invalid and cannot be successfully parsed.

    So it did parse with the tryParse, and it is redundant, but without access to documentation, it’s not too far fetched to wonder if it might not have actually parsed, and someone questioning it should not be dismissed as a clown. (in my humble opinion).

7 Pings/Trackbacks for "Coder or Clown?"
  1. […] ran across this post via the Code Project feed.  If you want to stir up debate, define your personal criteria as to […]

  2. […] 4. Кодер или клоун? […]

  3. […] Coder or Clown? 这篇文章翻译而来。 编译/外刊IT评论 赶快分享到: Facebook Twitter Delicious […]

  4. […] article is from the Coder or Clown? this article […]

Ed Guiness

I am the author of Ace the Programming Interview, published 2013 by John Wiley and Sons. In 2012 I founded, a volunteering organisation for programmers. I have been a professional programmer for more than 20 years, and a hiring manager since 2004.

Ask me anything.