Why Can't Programmers.. Program?

After 10 years writing C in low power embedded systems, including a fair bit of interviewing, what seems more interesting than asking candidates for a solution to a given problem is to explore their reasoning while arriving at the solution.

Oh, and VB isn’t a programming language.

VB isn’t a programming language? Neither is C. C is for girls. Why don’t you write in pure machine language like the rest of us men?

Thanks Alan B, I wish there were more girls using C, it would make the office a much more interesting place to be. Why not use pure machine language? It’s not portable and any company that wrote a significant portion of it’s product like that wouldn’t exist for long.

Naturally VB has its place but interviewing for C (or even assembly coding) jobs is so much more fun as there are so many more subtle issues to discuss than in highly abstract languages. For example above many posters have made statements about ‘inefficient code’, but nowhere in the design was efficiency stated as a requirement.

Why are you programmers posting solutions? Do you really need to prove yourselves to an anonymous horde that you are in fact number 200, and not number 199? Are you in the top 1% because you can do this ridiculously simple task, or are you in the top 99.9801% as Joel Spolsky points out in his article? I’m thinking it’s the latter.

Erm… why would I want to Fizz my Buzz with a FizzBuzz?

I agree with the article, I think there are too many people out there who don’t know how to write code in their head…

But…

That doesn’t make them a bad coder or designer to be apt. Coding has become so abstract that most modern coders tend to be designers due to working with heavily gui based apps from Windows form coding to Web apps. So we could blame MS for doing this, but its not really their fault.

The days of the lone coder are gone, most if not all coders have no need to learn or retain any of the stuff they get taught in their college/uni and certainly its not a requirement in a job.

However I think coding should be about architecting a solution and that means working from the ground up. A good coder is someone who has knowledge of each area they are interacting with, not necessarily deep knowledge of a technical component but enough of an understanding to appreciate how their solution will fit into the wider picture.

Coding should be about elegance. It should be like designing a really well made web page that employs lush CSS and is a visual treat to look at. Code should be the same, well commented and fluid in its layout making the code appealing to read.

I have come across too many coders who simply code out of need, usually to meet out of proportion expectations resulting in badly formed code or a solution that has far too many shortcuts in place.

Each to their own though, every problem has a particular solution however I think what this article was touching on was the fact that the core foundation skills of a coder are not present in most interview cases and this is worrying but I think a growing trend.

When you have hand-holding applications like Visual Studio.NET there is no real need to retain information as you can for the most part, cut and paste your way to a solution. :stuck_out_tongue:

Adios,

T

“Oh, and VB isn’t a programming language.”

This monkey does not even know that VB was a huge success for MS.
It is the most successful and productive language alongwith Java. I wonder if anyone uses C for application programming.

What is funny to me is how the majority of people who wrote there code on here did the fizz/buzz portion correctly but forgot to print the numbers to screen for the rest.
Maybe the programming world just needs a little attention to detail instilled in them.
You should put up a stat on how many people actually tried to post the code on here and how many of them got it correct!..
Mushoo

I think you are being too idealistic.

Being able to code does NOT make a good programmer?

Its all about resourcing?
http://www.google.com/codesearch
And getting the job done.

a,b = b,a

Ruby rocks :slight_smile:

Jeff, give a programmer a clear spec, and they’ll do it! It’s no wonder so many people immediatley started tapping away and created their solutions!

It when real world specifications get handed to programmers and the programmers have to spend 80% of the project time getting the specification clarified.

No brainfuck solutions? C’mon guys

The quality of a good programmer is the ability to know how to beg borrow and steal the right code - AND when not to try and solve a problem from scratch.

Interview of two candidates
Q Write a class to put these items in a linked list.

Candidate 1 Wrote a nice linked list class and used it - failed
Candidate 2 Derived class from a library linked list class, and used sample code - Got job and went down to pub to celebrate!

Having interviewed many so called developers I have come to the conclusion that programming is not necessarily judged just on technical skill, but on aptitude.

If an interviewee can show understanding of loops\variables\recursion in pseudo code, they can be taught the implementation in a given language in a few sessions - I normally take time out to teach any new developer coding standards anyway.

Have enjoyed seeing FizzBuzz in obscure languages, here’s my contribution in VFP\Foxpro code:

FOR intLoop = 1 TO 100

? IIF(MOD(intLoop,15)=0,"FizzBuzz", ;
  IIF(MOD(intLoop,5)=0,"Buzz", ;
  IIF(MOD(intLoop,3)=0,"Fizz", ;
  intLoop)))

NEXT

Nick Franceschina,the very best:))))

My version starts with “copy con fizzbuzz.com” but it doesn’t seem to be x-platform, so I’ll refrain from posting it.

I still liked my version in C using one mod operation (i % 15) and a switch statement instead of ifs and elses.

I’m sure we’ve beat this thing to death, but here ya go perl fans:
for (1…100) {print $_ unless (($_ % 3 ? 0 : print “Bizz”) || ($_ % 5 ? 0 : print “Fuzz”));}

This blog generated some comments on ISCA BBS, so figured we’d all take a crack at it in our preferred (and not-so-preferred) languages.

Figured I’d post this for perl folks to enjoy. Didn’t realize b4 nesting in unless statements was possible like that, but hey…how often are we writing obfuscated code people have to think about to understand? Kind of pointless unless we are trying to tell all the other coders…gee I’m so much l337 than you, you’re pathetic (which one wouldn’t due in a professional shop anyway).

I prefer to ask why can’t programmers program tests?

Unit tests are a great test of a programmer/developers skill and I think they should be a requirement for anyone in the modern age.

“At Vertigo, we require a code sample before we even proceed to the phone interview stage.”

I think that is a great idea !

The only thing better would be if the company was required to provide code samples to the interviewee … you know, at a later stage in the process, perhaps right before offering a position.

One of the things I hate the most is going through an interview where I am grilled on the most obscure nuances of a language, the type of things you almost never encounter, only to find out after accepting the position that the developers at the company do NOT follow in reality what they preach in the interview.

A proper XOR swap:

a = a ^ b;
b = a ^ b;
a = a ^ b;