Why Can't Programmers.. Program?

Hey Stu,

It took me 13 years to get a 2 year degree in Data Processing (they didn’t call it “Computer Science” back then). Can you infer my intelligence from that? Can you infer my programming skills from my failure to be able to add in hex?

Basically I am a self taught Software Engineer.

Today, I am an independent (currently writing map and delivery software). I charge $127.00 an hour. I have clients banging my door down. They are referred to me by previous clients because of the work I did for them.

So, to the employer who hired the geek, you probably made a good choice. But how many “great” choices did you pass up because they didn’t pass your ‘brain pan’ test?

I still can’t add in hex. And I still don’t care…

Respectfully, laughing at your ignorance, all the way to the bank…

Now, what worries me is that I’m a designer and I could answer to the questions such as FizzBuzz and some dealing with recursion…

I’ve only been programming a little under a year, but I don’t think that I could do the FizzBuzz program off the top of my head. Why? Well, the idea of the loop is simple enough, however I have NEVER needed to know if a number was divisible by another, so I have no idea what function finds that for me. If I were given the chance to look that part up, then I wouldn’t have any trouble.

Amazing. The comments on this thread are full of people criticizing the article, but it seems like most of the code examples posted here appear to completely back it up! It is shocking how many of the “coders” that posted here did not do simple things like initialize their variables - resulting in code that counts from 0-100 (read that as false positives since 0 mod 3 and 0 mod 5 = 0) - or display ALL numbers INCLUDING multiples of 3 and 5.
Maybe the problem is not so much that most “programmers” can’t code, but that they can’t follow directions.

WHERE IS THE COBOL?!?!?

Man, it’s been years…


  • This is what a cobol program used to look like…

*First you had your variable declaraction section or something…

WS-COUNT-LOOP = TYPE INTEGER;

bla bla bla!! Man, I can’t remember it at all… had to learn that stuff freshman year…

^ Need I say more? ^

its probably due to the fact that most web app programmers dont have to do lame-ish tasks like that

Speaking as a newly hired entry-level programmer, I think this post is completely ridiculous. I wasn’t able to answer your FizzBuzz question very quickly (although the logic of it was obvious), but I was recently hired by the IT division of a top I-banking company anyway. What’s more, I don’t think they cared if I could code that well yet. What’s more than more, I think they were correct not to.

I’ll be honest, I didn’t think I would get the job. I’m not even a CS major (Math major, CS minor). But they hired me because I’m smart and demonstrably trainable, and have passions outside academia. Basically, I represent a low risk. They can train me however they need to and feel comfortable in the belief that I will be able to contribute. But the fact that they have to train me is not my fault. Schools don’t teach students how to code anymore, don’t you all know that? How can an institution like that keep up with all the changes in programming that happen so, so fast. Do you know how much php, ajax, C, C++, perl, FORTRAN, COBOL, or Ruby I was taught? None, nada, zilch. It was “on me” to learn these languages if I needed them for an assignment, which was rare. The only thing I was taught was Java, and not very much of it.

However, what I WAS taught was theory and architecture. Heaps, stacks, linked-lists, graphs, hash-tables, classes, inheritence, search trees, Big-O, min-cuts/max-flows, database management, logic and set-theory, optimization, and all the basics of data architecture. Hell, I know more Assembly than I do C++!

This knowledge spans all disciplines within computer science and any language. I might’ve gotten a job designing websites for a 2.0 or helping to manage a database for a bank. There’s just no way to know how I was to focus my college studies, so I was given the big picture instead. I think this will work, I’ll find out for sure soon enough.

Java:

    String s[] = {null,null,"Fizz",null,"Buzz","Fizz",null,null,"Fizz","Buzz",null,"Fizz",null,null,"FizzBuzz"};
    int i = 0;

    for (int count = 1; count =100; count++) 
    {
        if (i  15) 
        {
            if (s[i] == null)
                System.out.println(count);
            else
                System.out.println(s[i]);
        }
        else
            i = 0;
        i++;
    }

Jeff, having ‘programmers’ attempt to write this type of program in an interview surely will weed out a crap load of candidates…but just because you can write the FizzBuzz program within a couple of minutes on a piece of paper doesn’t really mean much either.

From what I can see it only means you understand IF statements and comparison operators. I know designers who are crafy at coding JavaScript who can pull this program off in 5 minutes but I wouldn’t dare consider them for a real programming job. Why? Well this is just really the tip of the ice-berg…and I liken being able to code this statement as someone capable of changing their car’s oil. Which by the way a crap load of people can’t do either. Of course would you call the few souls who do change their oil mechanics???

-Ralph

Jeff,

The ADO.NET Orcas Entity Data Model will significantly reduce the code required for both Fizzing and Buzzing activities. Additionally, you may gain value from the ASP.NET AJAX Framework, which can update your end user’s page with Fizzes and Buzzes as they are computed.

Hope this helps,
Scott

Far too many comments for me to read through, so forgive me if this has already been stated.

Regarding the no-temp-variable swapping: For one I don’t think this says anything toward or against anyone’s programming ability. Especially since the solution offered won’t work in every case.

The biggest flaw with the plus/minus solution is that overflow can and will occur for large numbers. The better solution is to use three XOR operations. And even that obviously wont work for non-numeric variables (strings, objects, etc).

And it appalls me to see so many people actively not using loops and calculation in the FizzBuzz problem. (i.e. the people listing "print 1, print 2, print “fizz” … etc.) If I were hiring a developer and had a candidate that said outright “I don’t know” versus a person who did this, I’d take the “I don’t know” guy/gal.

I agree with the one who says, if u want a good programmer, don’t put the contraint (must hire only graduates), being one does not guarantee success at all. I code since 1990 and have seen lots of good software developers and most of them where just self-taught. Important organizations have lost worthy resources because they were asked to hire graduated people just to fulfill requirements for the job’s description. FizzBuzz test can be a good thing but it cannot be the only thing to test a good programmer, because some clever minds owners that don’t have resources to get a degree may be awaiting for someone to help them launch the rocket, then they will take you to mars and venus, who knows, but If you don’t give the chance, someone else will do.

The question I asked many candidates was

Write a function to test if the argument is part of the Fibonacci sequence.

Many candidates don’t know where to start.

But not 199 out of 200.

Is HR not screening anyone out for you?

Far too many comments for me to read through, so forgive me if this has already been stated.

Regarding the no-temp-variable swapping: For one I don’t think this says anything toward or against anyone’s programming ability. Especially since the solution offered won’t work in every case.

The biggest flaw with the plus/minus solution is that overflow can and will occur for large numbers. The better solution is to use three XOR operations. And even that obviously wont work for non-numeric variables (strings, objects, etc).

And it appalls me to see so many people actively not using loops and calculation in the FizzBuzz problem. (i.e. the people listing "print 1, print 2, print “fizz” … etc.) If I were hiring a developer and had a candidate that said outright “I don’t know” versus a person who did this, I’d take the “I don’t know” guy/gal.

i haven’t used MOD since my vb.net class. and it’s never come up in the real world so far, so, i might just have tanked on the question.
i know in an interview once i was asked how i would reverse a string in vb.net - and my brain went thru getting the length - then setting up a loop etc and on and on. and later i learned there was already a function in the language “StrReverse”. so, i can see how it’s pretty hard to set an interview test to target a potential employee’s experience. the best interview i had, they gave me a pc, Visual Studio 2003 + sql server 2000 and said you’ve got 45 minutes, here’s the sa login. make a web application that pulls this and that. no inline sql (only stored procedures and they wanted it in tiers [data-access, business logic etc all in separate assemblies). i aced that in 25 minutes. but, i had been programming like that (at the time) for two years. i’m afraid that would be easier for me than FizzBuzz.

My impression is that interviewers that give programming tests at best are merely demonstrating that the don’t understand human nature and at worst don’t actually know how to program themselves.

For those that think that tests are relevant have you actually bothered to test the test itself? Have you done the following procedure?

  1. Created a written form of the test.
  2. Distributed to developers at your company or perhaps even a sample test group
  3. Provided a negative incentive such as telling them that their results will be reflected on their next performance review. (This is to provide the ever popular ‘under pressure’ climate which tests are usually rationalized with.)
  4. Required that they do it with no references and no interaction with their co-workers.
  5. Using the results from above process to create what a ‘correct’ solution looks like and to have some idea of what variances might occur.

If you have done the above then your test actually has some meaning. If not then you are merely deluding yourself into believing that your test has any objective meaning at all.

I have seen the following at interviews.
A. The interviewer provided a test which they obviously made up during the interview itself. It took longer for them to describe the requirements of the test (and to figure them out via my questions) then it did for me to answer it.
B. The interviewer tested me with a simple code example. I answered and then commented on the fact that I had answered exactly the same question in the last week on a popular language programming news group. The interviewer became very flustered and was actually somewhat incoherent for the rest of the interview.
C. One interviewer tested me with an excercise that required GUI knowledge. I repeated verbally what was witten on my resume that I hadn’t worked on GUIs in years and that I wasn’t applying for a position that had anything to do with GUIs. Actually I emphasized that and the interviewer assured me the position didn’t need GUIs. And yet the interviewer still insisted that I needed to attempt the test.

Myself I have found the following (yes I have been responsible for technical interviews in the past.)

  1. I attempt to determine if the person is open to criticism of their work. (I give tests so that I can criticise their work and see how they react.)
  2. Does their history and the interview process lead to the conclusion that they are willing to learn?
  3. Do they exhibit the ability to both listen and verbally communicate?

Given that a candidate passed the above in a positive way then that is all that matters. I do this because I don’t believe it is possible to give a 5 minute (or hour) test and accurately determine even within a broad scope the programming ability of anyone. I also know that people are seldom productive the first day on the job. However people that can learn and learn from criticism will be more productive in a year than they are now regardless of their ability. And that does matter.

Finally I must mention that all of this completely ignores the fact that interviewers themselves are often incompentent in the interview process. For example…

  1. One interview process (which I was not part of) consisted of two interviewers arguing with each other for 15 minutes while the interviewee was sitting there.
  2. One interviewer couldn’t even express questions coherently.
  3. At more that one interview it was very obvious that the interviewers hadn’t even read my resume, hadn’t bothered to even prepare for the interview process and had a significant problem keeping a dialog going.
  4. At one interview within five minutes it became obvious that not only the interviewers (none of them) had bothered to read my resume but apparantly no one else at the company had either. I had absolutely no experience in the job that they were looking to fill and they were definitely looking for experience.

At our dept. special attention was paid to developing logic than learning any specific coding language. Most of the times we had to choose the language for the given assignments and also had to give explain why it and not any other, during our assignment reviews. During my degree i used to get frustrated thinking that my friends in other colleges/universities were already talking in C#, ASP.NET and all that stuff. But now i understand the value of it. Languages can be learnt easily, what takes time is developing logic. Thats what universities must focus on not on give new technology specialists. Such candidates usually find it hard to get adapted to new things.

I think asking a programmer to write at least some code in an interview can only be a good thing. Those that enjoy or are any good at it will thrive on attempting to answer the question. Those that don’t enjoy it will just normally sit there staring, thinking, but not attempting. It doesn’t necessarily have to be a code or logic based problem, just any problem which requires a bit of thought and effort.

Whether it is completely correct first time, is neither here nor there - how many developers write 100% bug free code, every time? Why do we use debuggers? Test Driven Development? Granted, these should really be last resort techniques used after a very good initial attempt. Be great if somebody had a go in an interview using TDD, on paper!

My personal though is that this sort of question should be used solely to see how a candidate approaches the problem. If they sit there and cry, then you know they are unlikely to handle any sort of pressure situation. If they get it wrong, so what!, let them know it’s not quite right and ask them if they can spot the error against the requirements (debugging). If their code is correct but verbose, ask them if they can refactor it, so that it does the same thing a) more efficiently OR b) with more maintainable code. You should also present them with a mess of code that does the same thing, and ask them to a) work out what it does [understanding others code and methods] and b) spot any errors [debugging other peoples code]. These are the practices that are required by a “developer” (not a programmer), and so long as they understand why they’re needed, and make a good attempt, they’re potentially a good candidate.

Granted, if we could all write 100% correct code in our head (without a computer), we’d have a world full of wonderful, never failing software… this ain’t a perfect world though!

A personal gripe of mine … I find spelling mistakes in code to be my biggest bane, especially those where the developer has copied and pasted throughout and never spotted it! Or has just continued spelling it wrong, because they couldn’t be bothered to correct it.

I am a self-taught programmer. I started out programming batch scripts in Windows 3.1. After that I dabbled in HTML 2.0. THen i was introduced to Borland C, and from there became aware of assembly language. Assembly language became my hobby for a while. I’ve written over 3000 lines of assembly code, hand-coding any libraries I needed. Unfortunately, I didn’t think to look on SourceForge for free 32-bit assemblers. So here I am in the era of 64-bit multithreaded-multicore processing and I’m fluent in only Batch script, assembly for the 80286, and DOS-mode C. Learn from my mistakes people, and if you;re a programmer, take every effort to stay on the cutting edge.

kcm: “Your interview question to swap the value of two variables with out using a temp variable is technically impossible.”

Wrong. See my post above that shows, step by step, how to do it using XOR. Since the intermediate results are stored in the variables being swapped, no temp variable is required.