Why Can't Programmers.. Program?

Hi, I’ve been reading all this about lower level programming and have to wonder where we are heading into the future. In the early years of computer science we used punchcards. These often used assembler to solve problems because memory and cpu were scarce. There was good reason for this. Then we progressed to C which is a pseudo high level language offering some of the benefits of bit manipulation etc… and procedural algorithmic concepts like … swapping variables and dynamically declared memory allocation. fast forward to now and we use object oriented principles and the procedural tasks have been ‘done to death’. My point here is that computer science is a progression from the lower level to the higher level abstraction to solve larger and larger problems.

If we are trying to swap variables over and over… why dont we just call a library and let the cpu increases over the years deal with inefficiencies. Where do you think we will be in 100 years time as a group of people who program computers. I hope we have moved on from solving the smaller problems or else we simply wount progress. The concepts being grapled with by today’s programmer …stretch far beyond swapping 2 variables or making a simple loop to incremement code etc…

Assembler routines are very very fast because they squeeze every efficiency out of the chips… but they are hardware dependent.

Algorithms to swap variables or loop may similarly rely on architectural aspects to complete. we need to progress here… and our new programmers must start from a higher level of abstraction or else they’ll be punching cards for another 100 years.

Software Engineering is soundly based on the principle of reuse… point made.

I think the reason simply boils down to a lack of academic background. A person can be as clever, intelligent, and self-taught as they please, but likely they won’t even -know- what a linked list is unless it’s been introduced to them. I don’t think the self taught programmer is going to grok things like the importance of a well-rounded knowledge of data-structures.

…of course I did see that you mentioned the problem being rampant even amongst some PHD holders - it’s just been my experience that a lot of people are eager to be programmers because of the employment opportunities and not so much a love of the craft.

I find this very disturbing. At the college I currently attend, if I told my professors that I couldn’t write a snippet of code that counted 1-100 and displayed “fuzz” or “buzz” on every few lines… I think I may be shot on site.

There is a trade-off however between students now and then with the amount of public code published on the web today. This increases academic dishonesty with CS students dramatically I’m sure.

I strongly feel that that was a different generation. By no means am I saying programs at major universities are perfect.

Oh and thank you everyone here for showing your 1337ness that you can write fizzbuzz. =P

What I find is even more horrifying are “coders” who start writing code without understanding the problem. The most powerful language I “code” in is English. But I see people whipping out “FizzBuzz” stuff without (1) finding out what the client/boss wants, (2) getting the specifications of the project, (3) defining the data structures, (4) oh you get the idea.

I find programmers that wonder why they have managers. It’s for exactly the above reasons. They think they are sooooo superior, but left to themselves they produce piles and piles of pretty nothings that may be elegant, but totally useless. The “useless” manager is the one that coordinates everyone into producing something useful.

I’ve done large projects, rescued others. The ones I’ve rescued were often rescued the fastest by throwing everything out, going to the meeting room, and defining what we were doing. We had the entire project sketched out in English before a single line of code was written. Then we looked in the trash heap to see if anything could be reused (usually remarkably little), and then got the project moving. This was something that had been stuck for months because all everyone was doing was writing code. No one was thinking about what the goal was.

Yeah, there are some junior colleges that are producing poor programmers, but there are good programmers out there too. But not if you are too cheap to hire them.

How to swap two variable without using a temp? Irrelevant in today’s world. But I remember a different age when you ran out of registers on a processor, and were counting T-states for performance. I wish I could teach more people how to count T-states for the most commonly used critical subroutines and library functions. That was a lifetime ago.

Hey, enjoy everyone. Don’t take life (or coding) so serious.

I’ve gone back to school after 20 years of programming w/o a degree because I just want to be a better programmer. I am shocked by the overall ineptitude of my classmates. 1 in 10 can complete the programming assignments w/o help and only 1 in 50 really, truly love coding. I don’t understand why they are even studying CS. It’s infuriating.

I read an entry on stackoverflow.com (http://stackoverflow.com/questions/2464323/new-hire-expectations-am-i-being-unreasonable) and immediatly googled “FizzBuzz” which lead me to this post. After reading the post i had to try to solve the problem and the solution was already done in my head when i started to write down the code for it. After confirming that my method is correct and ignoring that the topic isn’t “Post your solutions beloooooow”; here’s my code:

http://wandborg.se/fizzbuzz.php

It is quite sad that people of such high academic (and sometimes corporate) stature can’t tackle these simple problems. Putting my two cents in, I see two issues that may be behind this.

  1. The First issue here is less related to the capabilities of a programmer, and more to do with their personality type. I have known many people, myself included, who to a certain degree have their ability to apply critical thinking short circuit when they are under the microscope.

The pressure of the moment causes one to start to piece together a solution from their declarative memory rather than letting their procedural memory handle the task as it would if their coding skills were not under direct observation / running clock (akin to the golfer who chokes on a would be winning shot because he “thought” about it).

Since some people who fail at the task under interview would excel otherwise, I would be interested in a statistical adjustment to make sure those who have a predisposition to choke under pressure are not counted as incompetent.

  1. The current trend in building an undergrad CS foundation is very code centric, rather than algorithm centric. What students need to learn, and what is the key to being an efficient programmer is understanding of the mathematical theory behind the solutions they write, not the rote memorization of syntax; sadly, the latter method seems to be getting ever more popular. The mode of thinking needs to be taught first, then languages can follow.

Hi from Italy…
if someone interviews me on how to swap variables or how to do fizzbuzz… well i just stand up and go away thinking… where the hell i’ve arrived… maybe they are looking for a pizza boy.

cheers

I’m 28 and learned to code when I was around 17, and used embedded systems that the company I was working for produced. I learned on the job, with an ex-military software developer. I had to learn to use memory efficently, use pointers and make tight code that was bomb-proof.

I have no formal computing qualifications - something I lambast myself over constantly. Reading this article has given me some comfort though. I can do all the above and a great deal more. Hurrah for experience - something no amount of money or tutor can give you.

Re Programming: See "how to write computer programs"
at www.civilized.com/programming.html
(and also see the example code
at www.civilized.com/files/msgfuncs.txt)

Shalom, gary knott

Several commenters have pointed out that problems like the swap without intermediate storage requires the candidate to know a “trick”. There are plenty of these gimmick questions that are popular with interviewers. Including some that have nothing to do with programming. “I just want to see their thought process.” No, you just want to sit smugly while they squirm. Avoid the trick questions. They reveal little about the candidate and too much about the interviewer.

I can’t believe that someone trying to get a Programming job can’t solve task like counting from 1 to 10 or the FizzBuzz one… In my first interview when I had ZERO programming experience, I’ve got similar task. It was something like:
Print the numbers from 1 to 20 so that if the program finds number that can multiply with 5, write “X” instead of the Number. Trust me, I’ve solved the task in 10 seconds. Sorry, but it’s unbelivieble to me that such big numbers of programmers can’t solve such task.

I see a problem with most (if not all) implementations I see here (sorry, didn’t read all of them).

This is what the problem says:

OMFG. I did more complicated things than FizzBuzz back in high school. Now I’m more disappointed in Comp Sci than I was before.

I wont bother posting my Delphi solution, but it took less than two minutes to write and do a quick verify of the results by eye. I think most good programmers could write this in a language that I didn’t know in about 15 minutes - there is not much that you need to know about a language to be able to write it (1 minute to write the code, 14 to learn enough syntax to be able to write it).

I had something similar to this. In the 4th hour of the interview, they asked me write a function that takes two params. A string and an integer. Find the largest product of n repeating numbers in the string.

I went completely blank. I don’t know if I can’t code with a pen and paper. i don’t know if I was exhausted and couldn’t think straight. But I could not write that function to save my life. With the help of the interviewer I got there, but why I couldn’t write a nested loop was beyond me. Pretty sad.

I noticed most of the sample code submitted does not correctly handle the case of the number 53. FizzBuzz usually requires you to check not only whether a given number is divisible by 3 or 5, but also whether it contains a 3 or 5.

In my opinion, a good programmer tries to first make sure they have properly defined the problem, try to devise a proper solution, perhaps considering several options and then picking the best one, do some testing, THEN implement it.

I suppose if they are a junior programmer or fresh out of college they might not deserve to get fired for acting like this. However, this would assume that someone who knows what they are doing has to double check all their work anyways, which usually means that they are pretty much useless anyhow.

I don’t think you can place the blame fully on programmers, I personally think the main problem lies with the system that programs are often trapped into. Most programmers will come out of university having just completed a very enthralling 3 or 4 years of high level computer science studies, they have just finished an amazing final year project and they are ready to take on the world and become the next Zuckerberg. But what always happens? They end up getting hired in some graduate scheme and promised an amazing learning experience and a chance to work on the greatest projects, yet most often they end up get thrown into horrible projects and given miniscule pathetic roles that they cannot ever possibly grow in. They struggle with that for 3-5 years, and by the time they’re ready to go and finally take on that great role they always wanted they get thrown back by the fact that because they ended up spending the last 3-5 years doing crappy jobs, they forgot the basics of programming, they have become corporate software engineers.

Indeed, these corporate software engineers will be good doing focused and well outlined jobs that are often part of a bigger and well constructed application, but what they cannot do is start something on their own, building from scratch, and this is their pitful, they’re relying too much on what’s there and not looking outside of their crappy JIRA user story to see the bigger picture!

I cannot believe I have to actually write this…

“Most good programmers should be able to write out on paper a program which does this in a under a couple of minutes. Want to know something scary? The majority of comp sci graduates can’t. I’ve also seen self-proclaimed senior programmers take more than 10-15 minutes to write a solution.”

Do you have no memory of what it was like to interview for jobs and take coding tests?
We are programmers, not novelists. I have never met a programmer who could code worth a shit on paper with a pencil. Even ignoring that the vast majority of people are really bad at interviews and are operating at 10% during one, coders do not have good handwriting. And all the muscle memory and situational memory is completely gone when you hand us a pencil and a blank piece of paper. Add to that that this is all during an interview, and as programmers we have no idea how do handwriting, and obviously most fail.