Why Can't Programmers.. Program?

I really find it unbelievable that the fizzbuzz program is so difficult for so many people. I graduated college with a BS in computer science about 6 months ago and found this to be very easy to write. I cannot imagine any other students that I graduated with having any difficulty solving it. However the point that many graduates are poor programmers is definately true. I noticed many of my fellow students having trouble with simple programs, its very common.

I will sell a FizzBuzz cheat sheet to anyone interested. You name the language, I’ll name the price. No job to small, no fee too large…

What I have learned in my few years of solving problems, is that the best problem solvers know how to find answers and do not necessarily rely on rote memorization of language syntax.

Test your canidates on ability to find solutions…

If I don’t know something I will tell you, and if I cannot fathom the answer, I will tell you that as well. But do not deny me the answer and the reasoning behind the answer, or it will drive me nuts whilst I search for the answer (and I mean to the point of troubled dreams)

But, thats me and my problem solvers complex…

I have a MS degree in CS, over 25 years as a software engineer, several years of teaching graduate students in CS. I have been on both sides of the hiring process. My personal opinion is that you can see morons on either side.

I’ll start with the lousy programmers. I never give candidates recursion tests, nor tree traversing, or swapping two variables without using temp. Most of these are tricks, which don’t show candidate’s ability to program, but show how “smart” the interviewer is. Of course, I do ask them to tell me about it, but it’s strictly conversational, and that’s enough. And don’t forget that embedded programming is not a financial programming, not databasing, not genetics, not statistics, neither web. These are different object models with different objectives.

Still if I have to ask them about coding I suffice with the IF statement. It’s so common that one can not overestimate its importance. Its use shows how much you know the boolean basics, the functional basics, the assignment rules, etc.
So here is my test:

if var1 = true  then
	var2 = true
else
	var2 = false
end if

or C#, Java style:

if (var1 == true )
{
	var2 = true
}
else
{
	var2 = false
}

The question is: How can you rewrite this in one line statement?
Well, the answer is:
var2 = var1

I give them the answer and ask them to explain. Most of them don’t understand why var2 = var1. I have encountered this or similar type of coding thousands of times. They never heard of truth tables, they didn’t know how to verify their complex IF statements. Would I hire such a person? Depends on the chemistry, maybe I’ll teach him later…

Now about the lousy interviewers. Yes, most of them are like that. Usually, (MS, Amazon, other big companies) conduct the phone interview using lists of predefined questions and answers, and the interviewers don’t understand anything and if you say something different you loose. I had similar experience, where a girl straight from the college interviewed me (I had over 20 years of programming at that time), using a list with questions that she did not understand, but still she insisted on her opinion. Would I go to that company? No.
There are others, who just want to tickle their ego - they know few algorithmic tricks and ask you to invent that in front of them (if you did not know it beforehand). Well, I usually ask them too – to explain the bubble sort algorithm or something else.

Most of the questions on interviews are on algorithms. This is wrong. Much more universal and useful is to ask about program structures, structured and object oriented programming, using unit testing, debuggers, source safe and other productivity tools. I was amazed when a candidate with otherwise strong appearance did not like using a debugger - he liked using “printf”.

The process of hiring the right person is complex. There is luck, there is chemistry. After many years I understood that people work in teams and you should not hire the best knowledgeable programmer, but the fittest (to your team) person.

Over here at FogCreek we’re working on a few updates to Wasabi for this very purpose so we can compile our FizzBuzz implementation into PHP and VBScript.

In fact, I think it would make good sense for us to create a new language specifically for FizzBuzz implmentations on the web. We’ll call it “Horseradish”.

@Robert Biggs
I will say designer more then programmer. I kindly ask that you not force me to press ENTER 100 times. Thanks! :smiley:

25 should be “fizzfizzfizz” since it can be divided by 5 twice, and being an odd multiple of 5, is has the number 5 in it; which code is easiest modify to include this rule? It can also be played using roman numerals, hence 8 = VIII gets one fizz; which code is easiest to generalize?..

Over here at FogCreek we’re working on a few updates to Wasabi for this very purpose so we can compile our FizzBuzz implementation into PHP and VBScript.

Nice.

Also, I apologize for the errors on comment submission. This is a limitation of Movable Type; it re-renders the entire HTML for the post every time a comment is submitted. So if two people enter comments at the same time, you’ll see an error (but your comment IS saved).

Yes, I realize this sucks, but it’s typically not an issue until you have a post that goes hyper-viral (WTF?) and people are commenting every 5 seconds for hours on end.

It’s amusing to see this kind of blog including its comments.

Really.

Half of those who posted the solutions didn’t read the questions completely (the fact that you didn’t print out the number).

The other half who completed the solutions are either:
a) not optimized (1/3)
b) wrote ugly code (1/3)
c) did well. (1/3)

I’m also amazed to see the reply/reaction/whatsoever that “asking fizzbuzz is not ideal”, “why do they ask insert_problem for production code”, “the interviewer is nuts”, etc.

To those who pinch their 2cents saying that “as long as you can learn new things quickly”, I’d say: “good for you” and I’d say: “your 3 hours code XML-oompaloompa must be suck to maintain”. But it’s all good, you shipped. Congratulation. I bet someone will write a blog post about “just because you’re a quick learner doesn’t mean you can write clean, production level code” after this.

And this came from the audiences of Coding Horror blog.

I heard Google/Microsoft/Amazon interview is quite challenging, why don’t all of you guys at one point in your life take that interview before you post any code or comment here acting like the “ideal professional programmers” according to “ideal bloggers”. (For those of you who are currently working there, good for you, you’re a solid software developer)

The only ideal developer you would’ve hired is YOURSELF if this is the case with all the interviewing processes. Admit it, you think you’re better than anyone :slight_smile:

Well, the site maintainer removed a snippet from my post showing an error from the site; probably for security reasons, but it’d been nice to leave an [edited] note.


I'm quite certain that university is absolutely USELESS when it comes to software engineering/development.  Most profs learned from their profs, and so they learned Pascal and VB and Basic.  In real life, most people currently use C, C++, Java, JavaScript and XML.

In university, they take two weeks to teach the concept of an array, something which I taught (effectively) to a friend in roughly 30 minutes; including looping, pointers, memory, and slicing (which you don't get in university until what... never?)

My prof didn't understand that Java had been programmed in C, and is usually really translated when you run javac, and JITC'd.  My TA was quite adamant that ASCII has always been 8-bit, when in fact it started out from 0-7F, and was later extended with high ASCII and then more or less replaced with UTF-8.

They live in their own little world, away from real life.  It really pisses me off that companies only hire graduates.

There should be a Profession for Software Engineering. A computer Science degree is a waste of space. It’s over bloated with unnecessary Math classes and needs more classes geared towards what happens in the real world. They’re still working on a 1980/early 1990’s structure in the degree. Any real IT guys/programmers in the Industry will tell you that if you want to make the real money - go get an Engineering Degree. They get paid more, get the better positions and have more respect.

Not to mention half the instructors for CS degrees are ancient and need to meet modern reality.

I am studying for a degree at the moment, and I can see what you are saying Jeff. This problem is not necessarily the individuals fault, imho it is more down to the education system (in england).

I intend to become a professional programmer but from what I can see so far the IT course I am doing will not provide me with any practical programming skills. It will however give me a degree which shows that I can program in C, Javascript, Java, etc.

Just today I had my final C assignment marked. I got 84%. My code was fine but I lost marks for some omissions in my documentation such as not explaining what I had learnt from the assignment.

A friend of mine got 100%. This is nice but surprising considering that he wrote a program which in all practicality required a loop, without the use of one.

I have to admit my documentation has always been a bit on the sloppy side, but I do like to take my time ensuring that I produce code that is fast, effective, and easy to build upon. Unfortunately this does not seem to hold any weight as I could get a degree with the highest mark possible without even knowing how to use a FOR loop. Just some proof for you :wink:

It seems to me that the ability to program is rare because the ability to think about things as a series of steps is so rare.

I’ve met smart people who can’t break down a trip to the grocery store into a step-by-step sequence.

It seems that those who can do this can code, those who can’t cannot, and there’s no hope for them, either.

By the way, my Perl solution (which only took a few minutes to write/run/debug–you DO let the candidates have a computer to do this right?):

for (1..100){
	if ($_ % 3 == 0) {print "Fizz"}
	if ($_ % 5 == 0) {print "Buzz"}
	if (($_ % 3)  0  ($_ % 5)  0) {print "$_"}
	print "\n";
}

I have a MS degree in CS, over 25 years as a software engineer, several years of teaching graduate students in CS. I have been on both sides of the hiring process. My personal opinion is that you can see morons on either side.

I’ll start with the lousy programmers. I never give candidates recursion tests, nor tree traversing, or swapping two variables without using temp. Most of these are tricks, which don’t show candidate’s ability to program, but show how “smart” the interviewer is. Of course, I do ask them to tell me about it, but it’s strictly conversational, and that’s enough. And don’t forget that embedded programming is not a financial programming, not databasing, not genetics, not statistics, neither web. These are different object models with different objectives.

Still if I have to ask them about coding I suffice with the IF statement. It’s so common that one can not overestimate its importance. Its use shows how much you know the boolean basics, the functional basics, the assignment rules, etc.
So here is my test:

if var1 = true  then
	var2 = true
else
	var2 = false
end if

or C#, Java style:

if (var1 == true )
{
	var2 = true
}
else
{
	var2 = false
}

The question is: How can you rewrite this in one line statement?
Well, the answer is:
var2 = var1

I give them the answer and ask them to explain. Most of them don’t understand why var2 = var1. I have encountered this or similar type of coding thousands of times. They never heard of truth tables, they didn’t know how to verify their complex IF statements. Would I hire such a person? Depends on the chemistry, maybe I’ll teach him later…

Now about the lousy interviewers. Yes, most of them are like that. Usually, (MS, Amazon, other big companies) conduct the phone interview using lists of predefined questions and answers, and the interviewers don’t understand anything and if you say something different you loose. I had similar experience, where a girl straight from the college interviewed me (I had over 20 years of programming at that time), using a list with questions that she did not understand, but still she insisted on her opinion. Would I go to that company? No.
There are others, who just want to tickle their ego - they know few algorithmic tricks and ask you to invent that in front of them (if you did not know it beforehand). Well, I usually ask them too – to explain the bubble sort algorithm or something else.

Most of the questions on interviews are on algorithms. This is wrong. Much more universal and useful is to ask about program structures, structured and object oriented programming, using unit testing, debuggers, source safe and other productivity tools. I was amazed when a candidate with otherwise strong appearance did not like using a debugger - he liked using “printf”.

The process of hiring the right person is complex. There is luck, there is chemistry. After many years I understood that people work in teams and you should not hire the best knowledgeable programmer, but the fittest (to your team) person.

To “Dan” and “The E”. Shame on you for blaming education systems.

Actually, sucks to be you guys if you went to podunk college and looking to hire students from that same podunk college.

Why don’t you try and lure MIT students? UC Berkeley? or perhaps Stanford people? Waterloo up North? or perhaps students who did very well in ANY CODING COMPETITION (Topcoder comes to mind or Google SoC). You might actually get a solid problem solvers instead of someone who can JUST write C/C++/Java and XML-oompaloompa.

The problem is: you don’t know where to look. That also puts you in a bad situation: incapable of looking decent developers. Which leads you to an unfortunate complex problem: your company now is filled with not-so good developers because you don’t know where to look, therefore these top coders won’t work there.

Let’s quit bitching, if you want to have good colleagues or undermen, hire them yourself, look for them from where they belong. And if you get a raw talent, teach them, mentor them.

If you’re suck at mentoring them, who would want to work for you. If my boss expects me to know it all, why the heck I need a boss for?

Oh and to “The E”, I bet your school is a very small school that only gives bachelor degree (or maybe just diploma).

Have you ever heard this thing called “funding” for research where the profs actually fight for the money so bad? Well, in my university, profs actually do research. They came up with AspectJ, some fancy mammoth filesystems, some fancy Task plugin in Eclipse. Algorithm used by Starwars movies.

Quit bitching, it’s your fault to choose such university.

Oh and “The E”, Google came up because of those Math equations. So do some of those Microsoft technologies (Visio, PowerPoint to name few). How about Games??!! Hash function? RSA? Encryption?. Sheez.

Several programmers here have tried the problem, but have produced an incorrect answer. Either they’ve made an error parsing the problem, or they’ve not tested their solution to make sure it solves the problem.

While you guys were so busy frantically coding solutions to the FizzBuzz problem, you might’ve stopped for a moment to consider whether you were going to get owned by the < and > tags.

I fixed all the code samples with angle bracket problems. But be sure to check out my followup BEFORE submitting any more code in the comments, please. (although some of them were quite funny, and for that, I salute you)

http://www.codinghorror.com/blog/archives/000804.html

Has anyone thought of creating a web page where we can see cross-language solutions to the FizzBuzz problem? Once there are enough solutions (and optimizations) posted, perhaps it can be spun off into the Great FizzBuzz Programming Shootout. And don’t forget a job board and forums to connect with prospective employers. This is an exciting time to be in software development.

http://golf.shinh.org/p.rb?FizzBuzz

My friend, the internet is your huckleberry. The FizzBuzz programming competition in any language of your choice.

1 Like

I totally agree … I refer you to my blog post above on just the same subject …

You should all go see http://www.ariel.com.au/jokes/The_Evolution_of_a_Programmer.html
to see the difference in programmers.

My productivity question lies elsewhere. Can you work for 1 day without a mouse? Try it and see the horror on the users’ faces. Practice it and see the increase in productivity.

Oops! forgot to change a var int_Teller to intCount
Shame on me! I failed the test…

Yay!
Five minutes. (Whew!) My first one ever :slight_smile: