Discover the best of the web!
Learn more about Digg by taking the tour.
Why Can't Programmers.. Program?
codinghorror.com — It's no wonder recruiting good developers is difficult when (quoting the article) "199 out of 200 applicants for every programming job can ’t write code at all. I repeat: they can’t write any code whatsoever."
- 2412 diggs
- digg it
- Scarblac, on 10/12/2007, -6/+115It's true, and this is a very interesting article.
I think _many_ so-called programmers never do anything but copy-and-paste and adapt, or use Google. They can't start with an empty file and start coding. _Especially_ not on paper. It's worrying.- chrisgarrett, on 10/12/2007, -6/+48Yeah I think it is just so easy to copy and paste that a lot of "programmers" are losing some of their problem-solving abilities. That said I wouldnt be without Google now - how did we ever manage before? Heh
- groverblue, on 10/12/2007, -110/+29Yeah I think it is just so easy to copy and paste that a lot of "programmers" are losing some of their problem-solving abilities. That said I wouldnt be without Yahoo now - how did we ever manage before? Heh
- wikk!d, on 10/12/2007, -3/+177i actually can't write fizzbuzz... it's too complex. So instead, i wrote a scraping tool to search code.google.com for fizzbuzz solutions, pass it on to my proprietary debugging engine and then have it deliver the answers to an email processing daemon in a tarball'ed attachment that I will later untarball and post on my site.
programming is hard. - stankyfish, on 10/12/2007, -5/+47I've met plenty of people who can write trivial programs who suck at software development, and others who might have even forgotten which one was mod and which one was div, but design very solid software.
I don't know that a simple program is always the truest way to tell whether the person you're interviewing would be an organized thinker and conscientious developer. Of course you can't ignore some of the most basic omissions (or glaring inclusions) on a resume, but I don't think the article is necessarily proving much of a point. - ozziegt, on 10/12/2007, -4/+81We had an interviewee like this. We asked him to go to the board and write some code and he actually tried to get out of it. Crazy...
That being said, when you work on large software project you almost never have to start a project from scratch. On top of that big software projects are so complex many times you "forget" how to start a very basic program from scratch. I wouldn't say that is a sign of incompetency either. - ilyag, on 10/12/2007, -3/+125Heh I graduated with a Computer Science degree (average grades all around, but I passed everything), and at the time of my graduation realized that I was completely incapable of writing a fully functional program from scratch (one that's more advanced than some simple text-only number manipulation calculator). When I realized I was completely incompetent, I kind of gave up looking for a job in programming, assuming that my education was somehow not good enough for real world applications, and went off to do other things.
Now you're telling me that my programming ability is actually equivalent to that of the average Computer Science graduate? And that people can still get programming jobs like this!? Damn it! Where was this information when I needed it! - LocalScope, on 10/12/2007, -2/+17This doesn't really surprise me. I went to school with a lot of these type of people. How they were allowed to get a degree is beyond me. Group projects are painful when half of you know immediately how to solve a problem and the other half just doesn't get it even after explaining what the code base will look like (or even halfway into finishing it). Doing processes like requirements is a fast track to frustration hell.
- tont0r, on 10/12/2007, -2/+69@ilyag
I also graduated with a CS degree, but i realized something 3 of the 4 years into it. I realized that CS is *NOT* training to you be a programmer. Its training you on how to think. How to solve problems. They are training you to come up with the next big algorithm. Its not a degree in 'how to use visual studio'. That stuff you need to learn on your own. I took it upon myself to do my own little projects and eventually get an internship.
Personally, if you dont get an internship as a CS major, you are pretty much dead in the water and you(or your scholarship) just tossed out about 15k+. - drinkGreen, on 10/12/2007, -8/+91I'd like to add that 3 out of 4 people interviewing job candidates have no clue about coding either.
I don't have a degree (yet). My 6 career years of programming experience came from hands-on. So it really irks me when I goto an interview, and get asked ***** book questions like "Define the difference...." or "Name the 5 layes of....". I can program and look at code and tell you what won't work and why, but don't ask me stupid questions from a college book you read 2 hours before the interview.
Also, while I agree about the "copy and pasting" programmers, don't knock Google as a very valuable resource. - krellor, on 10/12/2007, -79/+7#include <stdio.h>
int main (void)
{
int i = 0;
for(i=0;i<101;++i)
{
if( (0 == (i%3)) && (0 == (i%5)))
{
printf("FizzBuzzn");
}
else if(0 == (i%3))
{
printf("Fizzn");
}
else if(0 == (i%5))
{
printf("Buzzn");
}
else
{
printf("%dn", i);
}
}
return(0);
} - krellor, on 10/12/2007, -40/+4hmm, html parsing killed some of it. I fixed the >, but the n at the end of the printf strings should be newline wac n.
- MikeD606, on 10/12/2007, -0/+99@krellor
you thought you were all cool and 1337 by posting your C code, but guess what? you fail! haha! That algorithm prints 0-100, not 1-100. No job for you! - krellor, on 10/12/2007, -9/+39@mikeD
lol. Yeah yeah, so many years of CS everything starts getting numbered at 0 for me. - gldfshnpcklejar, on 10/12/2007, -20/+1public class whatever{
public static void main(String args[]){
for(int k=1;k - bpapa, on 10/12/2007, -13/+3Why does your loop start at 0? Should just set i = 1 and let it run while it's less than or equal to 100
- akira117, on 10/12/2007, -4/+12The reason why programmer can't code is because most classes give you code to retype (no real thinking involved)
A good class tells you what you should code from scratch (ex. chess game), which is not the way they are used to teaching things in schools.
Most computer science courses totally skip that aspect of learning to code (which is really sad). - gldfshnpcklejar, on 10/12/2007, -17/+5public class whatever{
public static void main(String args[]){
for(int k=1;k<=100;k++){
if(k%3==0 && k%5==0)
System.out.println("FizzBuzz");
else if(k%3==0)
System.out.println("Fizz");
else if(k%5==0)
System.out.println("Buzz");
else
System.out.println(k);
}
}
}
THAT's highschool code, so this article has to be fake. - ezweave, on 10/12/2007, -8/+1bah... digg messed up my code (below)
- joshua5, on 10/12/2007, -3/+12I think this is not a fault of the 'programmers' but rather of the times we live in and the generation of people coming out of university. Its not surprising that in the age of the internet, when a computer science major has been taught and learned around using such tools that he or she would be at a disadvantage without them. You could argue that its in every programmer's best interest to have a good understanding and background in the bare bones basic programming methods and being able to do everything from scratch. However, I don't think you can really fault them for needing a variety of new-age tools at their disposal when those tools have always been available to them from their first programming class in high school.
I believe they're having a similar problem in law schools right now where the older professors aren't clicking with the younger students. The students have grown up accustomed to using tools like Google to do research but the professors prefer the older manual methods of actually reading the books. - PLUMCRAZY, on 10/12/2007, -56/+2Why do programmers always start counting at zero?
Is that something they teach you in CS classes? It makes no sense at all and is illogical. . . - HellifIno, on 10/12/2007, -9/+3Ya know, I'm GOOD at learning when my work challenges me to actually think. I can make database constructs that scare people when they try to look at the basics, yet actually USING what I created is simple and fairly idiot proof.
That said, I think I'm better off as a UI consultant at this point. In my job, I have to use Xerox software. On the surface, this seems a benign/useless comment. I mean, XEROX! They're HUGE!
Lemme tellya, their software sucks ass. It's classic bloatware. I won't go into details about the UI stuff, but I will offer up this gem: A droplist that contains 6 items only displays 5 of them. You have to scroll down for the 6th... This is not an exception, by any means, it's just a really obvious "DUH!???" point. - bpapa, on 10/12/2007, -9/+3Also I don't get why you are all writing the code with real syntax. You're all getting owned by the HTML sanitizer. Just use pseudo code
wow i got owned too - ezweave, on 10/12/2007, -6/+3Took about 30-45 seconds to write and then pop in an IDE and run. Come on! (Yeah the HTML sanitizer keeps mucking up my code, so forget that)
But having worked at a big company I know many developers who knew "processes" and couldn't code their way out of a paper bag. It would be more funny if they weren't getting paid six figures. - deabyss, on 10/12/2007, -5/+20If what you want to do with your life is be a programmer, do yourself a favor and don't get a Computer Science degree. Programming is not what a CS degree was meant for. Programming is merely a subset of computer science, and a very insignificant part at that. Go to a vocational school where they will teach you with a hands-on approach. You will also get real life experiences as a programmer by going the vocational route (and won't be as expensive). CS is more theory orientated. Computer Science is the bastard child of Mathematics and Electrical Engineering, and that is not going to change.
I can understand that in the old days CS is what you did to be a programmer, but luckily the times have changed and CS no longer fits the peg that is programming. - frenetic3, on 10/12/2007, -5/+33oblig python one liner:
print 'n'.join(["%s %s%s" % (i, not (i % 3) and 'Fizz' or '', not (i % 5) and 'Buzz' or '') for i in range(1,101)])
:P - aaronm67, on 10/12/2007, -1/+16@plumcrazy
Because in many programming languages arrays start at 0. - blatherskite, on 10/12/2007, -1/+15@bpapa and @PLUMCRAZY
I believe the reason programmers count from 0 when dealing with arrays of data is that they are not so much counting the data in the array as providing an address to that data in memory. So the first element would be at ADDRESS+0, the second element is at ADDRESS+1 (the next door down) and so on. I'll grant you it makes less sense in some contexts now in the day of high level programming languages, but it's still a highly useful way of looking at it most of the time. - BullTaco, on 10/12/2007, -1/+75>Why do programmers always start counting at zero?
It has to do with index relative machine instru.....
Wait, no, it is due to global warming. Starting at zero is more energy efficient. - Petronski, on 10/12/2007, -14/+3***Why do programmers always start counting at zero?
I'm not a programmer, but I have a theory: binary numbers in a given set start with zero and run to 2^(n-1) where n is the number of binary digits.
Whether this continues because of tradition or an outgrowth of machine or assembly language, I don't know. To me, however, it DOES make sense. - bobzibub, on 10/12/2007, -4/+18Here's a reason:
Think back to the golden days of pre-8bit computers.
Now you have very few addresses to work with. Very few data lines.
For instance if you have a 4 wire dataline to describe a small bit of RAM, that is 16 positions. The first position would be where all the wires are off. Translate that into code and it would be 0000 in binary. The last position would be 1111. On a simple computer, there would be LEDs showing this address. It would be silly to waste electronics in this environment translating this zero to 1.
Lunch is over. Back to programming..... - transeunte, on 10/12/2007, -3/+2@frenetic3
Should read '\n' (backslash n) instead of 'n'. You guys test your solutions, right? :P
Seriously, though, this article is too much buzz over nothing. - brundlefly76, on 10/12/2007, -1/+34Anyone who has taken or given a timed paper coding test during a job interview knows it is WAY more difficult then it sounds.
I have certainly taken tests where I could have cranked out perfectly working code in half the time for every question with a debugger and some man pages in front of me, but in a suit on the 20th floor of a manhattan office building, in front of 3 developers looking at the clock on the other side of the desk, and no debugging or reference, it can seem like rocket science - especially if you have been AFK for a few months between heavy coding.
As a result, I am very careful about tests I give developers today, and I don't use pen and paper, but casually quiz them during the interview about specific language features and approaches in a casual conversation. I find it much more accurate, dynamic (I can focus on stuff they seem weak on on the fly), comfortable for the interviewee, but most importantly the *way* they answer tells me much more about their skill level then I could learn on pen and paper.
Also, many great coders cycle in the amount of code they write (some jobs I did mostly project management for months), which can put them out of practice for a while even though it would take them about 30 minutes to ramp back up with a computer.
Probably the toughest test I ever took was a written Perl regular expression exam I took when interviewing for Yahoo!
The person interviewing me was Jeff Friedl, author of "Mastering Regular Expressions".
No pressure ;) - csfreakazoid, on 10/12/2007, -2/+12I have realized at my university that Computer Science majors who dont write code for fun and didnt know how to write code before college will never be able to write code. they always need help with the simplest of tasks. I still have to add semi-colons to people java code.
- ProximaC, on 10/12/2007, -0/+28I remember last year we were hiring for a coder who knew SQL. So we asked them to write a SQL statement that would return TWO columns from a single table. No joins, no where clause, no nothing. Just "SELECT ColumnA, ColumnB FROM Table"...
1 out of 30 applicants got it right.
He turned out to be a complete dick and we fired him 6 months later. - PatrickX, on 10/12/2007, -1/+9The reason why we have great integrated development environments like Visual Studios is so you don't have to memorize a lot of syntax trivialities. Being good at software development is not about memorizing syntax, it's about coming up with efficient and clean solutions to problems. It can be hard writing things out on paper without the IDE giving you some snytax hints. That's the whole point of using them in the first place. If you want to judge someone's programming, have them actually program in the environment they use. If they can do that well, they will be able to adapt to a new environment.
- DarkXanthos, on 10/12/2007, -1/+2Post you solutions here if you wanna show boat... I found this online looking for similar articles.
http://golf.shinh.org/p.rb?FizzBuzz
(not my site, but does have my stats ;) ) - MotionAesthetic, on 10/12/2007, -6/+0This is what I would have done with Python:
for i in range(1,101):
print (i%5==0)*"Fizz"+(i%3==0)*"Buzz" or i - DangerMouse9, on 10/12/2007, -3/+0@MikeD
Actually, you're wrong. The loop is pre-incremental. That's why it's ++i not i++ so you're the one that fails. - tybris, on 10/12/2007, -3/+1@deabyss
Nonsense. You really understand systems if and only if you can program them. Any Computer Scientist who is not a good programmer is probably not a good computer scientist. (Unless you're talking about the softer parts of CS which we usually refer to as IT) - MotionAesthetic, on 10/12/2007, -2/+0*****, I mixed up fizz and buzz.
That's what happens when you spend more time at college programming than playing drinking games. - deabyss, on 10/12/2007, -1/+4@tybris
No, its not nonsense. Programming is a small part of Computer Science. Obviously, if you cant program, then you cannot exercise some of the computing concepts you learn. This does not mean you take CS to learn to program. Programming is merely the telescope/hammer for which a CS will study computing. Or let me say it a better way: Learning how to program should not be the most important thing that you got out of a CS degree. - sancho, on 10/12/2007, -3/+0I wouldn't be surprised if part of the test wasn't efficiency. Everyone here but one person has shown code in the form of:
if i mod 3 then blah
if i mod 5 then blah
if i mod 3 and i mod5 then blah
else print i
In almost every programming language, you could, instead, replace this with:
if i mod 3 print fizz
if i mod 5 print buzz and break
if not i mod 3 print i
In languages where case statements don't have to be constants, you can do even more spiffy short circuiting tricks.
Basically, people are doing extra mod operations which can be expensive, depending on the platform you're using, and even if the platform isn't that slow, they're writing redundant code (calculating i % 5 twice per loop instead of once).
I'm not even that great a programmer. I'm absolutely positive that it can be done better, but I allotted myself 2 minutes to solve and add efficiency, for the purposes of simulating stress. - ezweave, on 10/12/2007, -4/+2for(int i = 0; i < 101; i++) {
System.out.println((i == 0) ? "" + i : (i%3 == 0) ? "Fizz" : (i%5 == 0) ? "Buzz" : "" + i);
}
Inclusive for 100, I guess (tried copying this in earlier). - muikano, on 10/12/2007, -0/+1Oh please. IDES are a great learning tool. But it should never be a crutch. There are always things that the IDE won't catch. And besides, it's like any language. Learning all the nuances helps you with other languages. I mean, you can understand why Visual Basic is written so weirdly because of the ties to legacy C. I mean, if you compare Python to Visual Basic, you can see how clunky VB is. But if you compare VB to C you see why there's 5 ways to do a while loop. Ruby is EVEN more modern.
If you don't have the syntax in your head, how are you going to learn? You'll do good enough but not enough to do great software fast enough. And how are you ever going to debug fast enough? Or take advantage of new languages as they are created?
It's important to be able to write code in your head. It's called Prototyping. - MrKite, on 10/12/2007, -1/+1for x in range(1, 101):
if(x % 3 == 0 and x % 5 == 0):
print "FizzBuzz"
elif(x % 3 == 0):
print "Fizz"
elif(x % 5 == 0):
print "Buzz"
else:
print x
I don't know Python very well, so I'm sure it can be shortened. But don't shorten it too much. I'll take code with a few extra lines that can be read over some cocky one-liner that's hard to read. - slythfox, on 10/12/2007, -0/+1Hmm... well to challenge myself (I usually avoid such exercises), I tried it in php and finished within 10 minutes. I have to admit, it isn't very good at all, but at least it works (consists of three while cases, two of which that find the multiples of 3, and of 5, and the third to compare numbers 1 to 100 to see if they are a multiple of 3, 5 or both). I don't use for loops much, thus my choice fr while loops. Usually I spend a lot more time on my code.
I'm not a very efficient programmer; I like to think in simple ideas to work with problems. Though, an other of a C++ programming book I read awhile back, pointed out that, especially if you don't comment, it's best to keep your code simple so that it's easy to fix if something goes wrong. Especially true if you are working in a team for your programming projects. - tknd, on 10/12/2007, -2/+1Javascript + HTML (replace [] with the usual):
[html]
[head]
[meta http-equiv="Content-type" content="text/html; charset=utf-8"]
[title]Fizz Buzz[/title]
[script type="text/javascript" charset="utf-8"]
function fizzbuzz()
{
var i = 1;
var multipleOf3;
var multipleOf5;
for (i; i [= 100; i++)
{
multipleOf3 = (i % 3 == 0);
multipleOf5 = (i % 5 == 0);
if (multipleOf3) printText("Fizz");
if (multipleOf5) printText("Buzz");
if (!multipleOf3 && !multipleOf5) printText(i);
printBr();
}
}
function printText(text)
{
document.body.appendChild(document.createTextNode(text));
}
function printBr()
{
document.body.appendChild(document.createElement('br'));
}
[/script]
[/head]
[body onLoad="fizzbuzz();"]
[/body]
[/html] - saikhan, on 10/12/2007, -1/+1In case anyone is interested in what high school programmers are learning:
http://digg.com/programming/What_are_HighSchool_CompSci_students_learning_today_Java_Courses_and_more - pickypg, on 10/12/2007, -2/+2@krellor
It would be much more efficient to do i % 15 instead of i % 3 and i % 5. - natmaster, on 10/12/2007, -1/+1This is probably due to the high demand for developers, coupled with low CS enrollment. There are so many jobs, but not enough people to fill them.
- Nachoo, on 10/12/2007, -3/+1This is my verbose Java Version .. ;)
public class FizzBuzz{
public static boolean dividesByThree(int i){
return (i%3 == 0);
}
public static boolean dividesByFive(int i){
return (i%5 == 0);
}
public static void main(String[] args){
System.out.println("Get ready for the FizzBuzz of your life!");
for(int i = 0; i < 100; i++){
if( dividesByThree(i) && dividesByFive(i)){
System.out.println("FizzBuzz");
}
else if(dividesByThree(i)){
System.out.println("Fizz");
}
else if(dividesByFive(i)){
System.out.println("Buzz");
}
else{
System.out.println(""+i);
}
}
System.out.println("This has been the FizzBuzz of your life!");
}
}
I tried to do it as fast as I can, so dont hate me on the way I was doing it. I know there are shorter/cooler/more sexy versions. - Oxidizer, on 10/12/2007, -1/+2> FizzBuzz100 :: [String]
> FizzBuzz100 = map fb [1..100]
> where fb x = if (mod x 3 ==0)&&(mod x 5 ==0) then "FizzBuzz" else (if mod x 3 ==0 then "Buzz" else (if mod x 5 ==0 then "Fizz" else show x))
Haskell for life! - kmarius, on 10/12/2007, -1/+0You don't need the extra else sentence. Use % 15
while (++$i < 101)
if(!($i % 15)) echo "FizzBuzzn";
else if(!($i % 3)) echo "Fizzn";
else if(!($i % 5)) echo "Buzzn";
else echo "$in"
- DangerMouse9, on 10/12/2007, -1/+0@nickgravelyn
Am I?
The loop says ++i, from what I remember it means add 1 to i then start the loop. If it was i++ it would be do everything in the loop then add 1 to i. - MrKite, on 10/12/2007, -1/+1"You don't need the extra else sentence. Use % 15
while (++$i < 101)
if(!($i % 15)) echo "FizzBuzzn";
else if(!($i % 3)) echo "Fizzn";
else if(!($i % 5)) echo "Buzzn";
else echo "$in""
Yes, but I wouldn't use yet another variable, because then you'd have 3 to maintain. I'd say if(!($i % (3 * 5)) echo "FizzBuzz"; assuming that those values are defined as constants. ;) - jstanden, on 10/12/2007, -0/+1@dangermouse9
The pre-increment and post-increment aren't in the context of before or after "the loop", they're before or after the statement involving 'x'. The third argument of a for loop isn't called until a after an iteration, so the distinction of pre or post doesn't matter.
You can see it visually with:
for(int x=1;x - jstanden, on 10/12/2007, -0/+1Whoops, got cut off there.
Simply run two 'for' loops back to back, one using x++ and one using ++x as the third argument. It won't make a difference.
- ninjacell, on 10/12/2007, -4/+6I agree. I know a lot of people who graduate as BCs and even consider to work on a MSc without knowing how to program or how to think algorithmically.
It can be argued that a computer science curriculum does not cover only programming lectures (in fact, often they cover only 1-2 lectures where they actually teach how to program), but other lectures require in one way or the other programming skills.- simpleid, on 10/12/2007, -0/+7Damn, I especially agree with that comment on thinking algorithmically. It's literally impossible talking to -anyone- about developing complex applications considering so few grasp what I talk about from -that- perspective. Instead people run off on pointless tangents assuming their keeping up with what the point is, don't people realize their own ignorance?
Fools! I hope things continue on this trend, it only makes my life easier.
(Not that I mean to come off as arrogant, but it has to be said, most "programmers" are deluded-bloated-rambling-full of hot air balloons. (sense my frustration?)) - blork1, on 10/12/2007, -1/+2Next year I'll be doing an MSc in Software Engineering (at the University of Sheffield) - I was thinking of taking CS, but it all seems too theoretical for my tastes. I actually want to learn to *program* well, not just understand concepts and models. That said, I think there is a lot of overlap between the two subjects. Anyone have any real experience?
- NoHandle, on 10/12/2007, -0/+6I'm not entirely sure where everyone else received their CS degrees. Personally, I did far more programming in my CS degree than any Software Engineer counterpart that I have spoken with or seen. Furthermore, the individuals in the CS concentration worked with many languages, rather than focus on just one and the tools that work with it. Engineering programming experience focused on hard core syntax principles, such as being able to write a program by hand that would compile without any errors (How is that useful?)
My CS degree definitely had some theoretical concepts, but leaning towards, as others have mentioned, solving algorithms and other problem solving skills. Software Engineering had the same theoretical "downfalls", but towards unrealistic ideals of software development. Things that people will only see at startups or maybe Google. In the end, university is about learning how to learn rather than picking up the skills you need to work. I have heard many times that people with diplomas are far more capable than those with degrees, for the first three years at least... - deabyss, on 10/12/2007, -0/+1@blork1
You are right to think that CS is theoretical. It is meant for those that want to study the science of computing, not actually program. While getting a CS degree will help you to better understand computing, it won't give you any experience in programming. This isn't a good/bad thing, its just how it is. Many people would find this frustrating, if you are one of these then try the SE degree. But the SE courses will deal with very little coding too. Instead you will be immersed in UML diagrams, design documents, and software life cycles.
You should instead ask yourself what kind of programming you want to do. There are many different industries and each one require a different kind of discipline. It can go from Real-Trim systems, Game Programming, Security, etc. etc.
Based on what you want to program should you then look at your education. - ABadInAlbany, on 10/12/2007, -0/+8When I was 6 or 7 Mom and Dad bought me a book on Tandy BASICA for Christmas, instead of Chuck Yeager's Advanced Flight Simulator, which I'd been begging for for months. It was both a blessing and a curse -- I've been thinking algorithmically ever since. Do you know how hard it is to be motivated do math on paper when you KNOW how much easier it would be to crank out an algorithm to do the work for you? Needless to say, my math grades weren't what they could have been otherwise.
- deabyss, on 10/12/2007, -1/+4@NoHandle
I don't know what class makes you write compilable code in SE, but that isn't what SE is about. It has everything to do with the software life cycle as well as how to communicate with other programmers when talking about programming concepts.
The programming you do in CS is not practical. I have a CS degree and I am glad I went down that route, but employers now-a-days are complaining that they cannot get someone out of school that can start programming without substantial overhead. Creating linked-lists is not something you will see in the real world. Same thing goes for people creating their own bubble sort or writing semaphores. There are tons of libraries with these funcionalities ready to use.
If you are a person that can take theory and apply it to the real world, then I recommend a CS degree. But not everyone is the same, and I have met plenty of people that complained they didn't learn any practical skills in college. These are people who have a hard time applying theory to the real world, and these people should get a different kind of degree that teaches those practical skills. - jordanday, on 10/12/2007, -0/+1I agree with deabyss, I've found SE MSc degrees to be basically training for becoming a manager, as opposed to becoming a better programmer. While pursuing a higher-level CS degree won't necessarily increase your knowledge or any language or development environment, it will help you understand how those languages or systems work. Sometimes this knowledge will be trivial, and sometimes it will be the difference between being "another engineer" and "the guru."
That being said, if your idea for your career path is engineer -> architect -> manager, you're probably better off with the SE degree. - rprouse, on 10/12/2007, -0/+10@simpleid
"don't people realize their own ignorance?"
The problem with stupid people is that they are too stupid to realize that they are stupid. ;-) - psyon, on 10/12/2007, -0/+2"Creating linked-lists is not something you will see in the real world."
Odd, I see them used, and used them farily often. Sure there may be libraries to do most things you need, but if everyone took that attitude, who would write the libraries? - deabyss, on 10/12/2007, -0/+0@psyon
People with CS degrees would write the libraries. Programmers who use them do not really need to know much more then that. Development is currently moving into a layered approach to programming, with each layer being more abstract then the previous. At the end of the day, developers only need to know the contract you expect with the function you are invoking.
Think about web services and service orientated architecture that is the latest craze. The average programmer doesn't need to actually write WSDL files and create stubs and all sorts of crazy plumbing that exist underneath the hood of these paradigms. They just create the web service through various libraries available in their language of choice. Some languages are more elegant with this then others, but at the end of the day, the average programmer does not need to know what is underneath it all.
It is the same with linked-lists. I know tons of programmers who would be incapable of creating one from scratch. However, they use them all the time b/c they know what to expect from them. - brundlefly76, on 10/12/2007, -0/+1My first programming job was at a web startup.
I had a BA in Communications and was programmer and technical project manager.
The guy next to me had a CS and was in marketing.
We actually did really well!
- simpleid, on 10/12/2007, -0/+7Damn, I especially agree with that comment on thinking algorithmically. It's literally impossible talking to -anyone- about developing complex applications considering so few grasp what I talk about from -that- perspective. Instead people run off on pointless tangents assuming their keeping up with what the point is, don't people realize their own ignorance?
- rodrigo74, on 10/12/2007, -3/+64The funniest part is to read people actually posting their fantastic FizzBuzz code in the comments section. Seriously.
- DenRoedeBaron, on 10/12/2007, -2/+16Someone please do it in *****... Maybe not?
- gharding, on 10/12/2007, -7/+14I think I'd not hire someone just because they could write VBA. That screams "seasoned professional", huh?
- KWhat, on 10/12/2007, -15/+12Whats even more entertaining is none of them have ever heard of the switch statement.
- PleaseJustDie, on 10/12/2007, -0/+30There's no point to a switch statement in the fizzbuzz problem, if elseif else works better than switch. If you were to use switch to test mod 3 and mod 5 you'd have to have 2 separate switch statements or put the switch inside its own loop. Its making more work for no purpose when an if elseif else statement works better.
- ell0bo, on 10/12/2007, -0/+14--- please beat me to it...
Explain to me why you would use a switch statement? Perhaps if you were going to set up some sort of binary system where Mod 3 gets 1 point and Mod 5 gets 2 and then switch of the combination ie (Switch (modres3 + modres5) {case0: case1: case2: case3:} )... but otherwise mister smarty pants (oh yeah, i broke it out) you would have to use two switch statements since there are two different possible values. No, in respect to memory and everything, two simple if statements are well enough sufficient for this problem. - gkzhang, on 10/12/2007, -2/+11Half of those are wrong. They forget to even print out the numbers that are not multiples of 3 or 5.
- tpink, on 10/12/2007, -5/+2I wrote my Fizzbuzz in machine code.
- Korexz, on 10/12/2007, -16/+2Switch statements are faster than nested if... that's why you would use a switch statement.
- ABadInAlbany, on 10/12/2007, -0/+9@Korexz: bzzzz, wrong. As has already been explained, you'd have to use multiple switch statements -- you're not testing a single value, you're testing the output of 3 different modulus functions. Tell me how you're going to switch on imod3 imod5 imod15 with a single switch block? Go ahead, tell me ... waiting!
- AlanLivingston, on 10/12/2007, -9/+2@pleasejustdie:
@ell0bo:
@abadinalbany:
This ought to work. It uses a single switch statement. A good compiler should generate the same code as if/else, as well. I didn't compile it, so just consider it a concept, not a completed solution.
int main(int argc, char* argv[])
{
for (int i=1; i < 201; i++)
{
switch (i%15)
{
// Multiples of 3.
case 3:
case 6:
case 9:
case 12:
printf ("Fizzrn");
break;
// Multiples of 5.
case 5:
case 10:
printf ("Buzzrn");
break;
// Multiples of 3 and 5.
case 0:
printf ("Fizzbuzzrn");
break;
default:
printf ("%drn", i);
}
}
return 0;
} - FreakTrap, on 10/12/2007, -7/+1PHP/Pseudo Code (no loop), sample switch statement
switch (0){ //zero
case (($i mod 3)+($i mod 5)): //if the sum of the mods of 3 and 5 is zero
echo "Mod 3,5";break;
case ($i mod 3): //if the mod 3 = 0 (and 3,5 don't mod)
echo "Mod 3";break;
case ($i mod 5): //if the mod 5 = 0 (and 3,5 don't mod)
echo "Mod 5";break;
default: //if neither
echo $i;
}
This should work... - tradernet, on 10/12/2007, -8/+6perl:
print$_%3?$_%5?$_:'Buzz':$_%5?'Fizz':'FizzBuzz',"n"for 1..100; - transeunte, on 10/12/2007, -3/+1perl <3
- ostracize, on 10/12/2007, -1/+11@tradernet
No way in hell do I would want to hire someone who programs like you
:) - HaMMeReD, on 10/12/2007, -5/+0Heres a 2 line fizzbuzz, dunno if it works, don't care, ternaries suck and I hate people that use them. (PHP btw)
//Infinite loop fizzbuzz
for ($i=0;1;$i++)
print((($i % 3 == 0) || ($i % 7 ==0)) ? ((($i % 3 == 0) && ($i % 7 == 0)) ? "FizzBuzz" : (($i % 3)?"Buzz":"Fizz") )) : $i); - koick, on 10/12/2007, -1/+4@FreakTrap:
It may work, but it's *****/non-elegant coding like that why I hate picking up other people's code sometimes.
Most of the time, coding the long way is usually better than the one-liners and tricks, because usually someday, someone will have to go back over that code... - wyrdness, on 10/12/2007, -1/+5If I was an interviewer asking this problem and someone gave me a solution using switch statements, I wouldn't hire them. Switch is not designed for this type of application. Use if/else.
- ronaldb, on 10/12/2007, -3/+4@HaMMeReD
"Heres a 2 line fizzbuzz, dunno if it works, don't care, ternaries suck and I hate people that use them. (PHP btw)
//Infinite loop fizzbuzz
for ($i=0;1;$i++)
print((($i % 3 == 0) || ($i % 7 ==0)) ? ((($i % 3 == 0) && ($i % 7 == 0)) ? "FizzBuzz" : (($i % 3)?"Buzz":"Fizz") )) : $i);"
So, apart from it being hard to read, and unnecessarily complicated, you also didn't read the specs:
1) The loop goes from 1 to 100, not infinite
2) The program is supposed to print Fizz for multiples of three and Buzz for multiples of five, not seven.
Please, don't call us, we'll call you. NEXT!! - ttntyler, on 10/12/2007, -2/+3for ($i = 1; $i < = 100; $i++) {
switch ($i) {
case $i % 3 == 0 && $i % 5 == 0:
echo "FizzBuzz";
break;
case $i % 3 == 0:
echo "Fizz";
break;
case $i % 5 == 0:
echo "Buzz";
break;
default:
echo $i;
break;
}
} - FreakTrap, on 10/12/2007, -3/+1@koick
Optimization. - NSMike, on 10/12/2007, -1/+6@FreakTrap
Maintainability > Optimization.
That should've been lesson number 1 in any intro to programming course geared towards those with a CS major. - tblanchard, on 10/12/2007, -0/+2What is even more funny is how many of them are wrong. Most. Nearly all actually.
- eric1, on 10/12/2007, -4/+62That's article is horribly over exaggerating. Yes, there are a lot of copy & paste programmers, but I don't know anyone who couldn't code the 'FizzBuzz' problem; that's like a first year problem, at best. Unless I'm on the of the magic 1 out of 100 programmers, this article is BS.
- chrisgarrett, on 10/12/2007, -3/+12As it says in the comments to the article, the people taking the time to read this stuff aren't the people being talked about. It's those who run on auto pilot, who never use the web for anything other than pr0n and cribbing code snippets, only turn up to get a paycheck and never spend any time educating their selves. I've met a ton of people like this unfortunately
- szembek, on 10/12/2007, -8/+2This is why I buried this post as inaccurate.
- dougmc, on 10/12/2007, -0/+23There are a lot who who stumble on a simple problem like that.
But 199 out of 200? No.
(Of course, one thing that skews the results, is that if you're a good programmer, the odds are better that you're already employed and therefore probably not looking for a job, at least compared to somebody who can't program something simple like this.)
I've also been given programming problems and told to do it on paper or on the board -- that's MUCH harder than typing it into a computer. - digduggler, on 10/12/2007, -1/+10I have a hard time believing even the worst programmer cant write something to count from one to ten.
- MrVandelay, on 10/12/2007, -0/+2hmmmm, perhaps the number 199 out of 200 is a bit exaggerated, however I suspect that there are many people who claim to understand how to code after writing "Hello World".
- austindkelly, on 10/12/2007, -0/+4They only gave one problem, and expected one solution.
To me that seems like a really simple program and I could do it in almost any language. I do not see how this would stump 199 out of 200. Perhaps 199 people didnt give the solution they were looking for. I am sure there were additional parameters to this test that we are unaware of.
Programming is a lot more complex and requires a lot more people these days. There is a ton of stuff I don't know about the various languages I have to program in, and thats why we are allowed to use the internet and others to help us figure things out.
As for senior programmers not being able to do this, they should be fired. WTF guys, its simple logic. - roflwaffle, on 10/12/2007, -1/+0@mrvandelay
Well, many people may claim to understand code after hello world, but how many of them are looking for jobs, or have degrees? I have seen some applicants that have screwed up on basic problems, but never to the extent of 199/200... Where do these people get their degrees?? - sponeil, on 10/12/2007, -1/+1@eric1
I agree with you completely. When my company was hiring during the tech boom, it seemed to be closer to 50% copy-and-paste coders. Of the other 50%, maybe 10% were good and the rest were mediocre. I got a CS degree at Georgia Tech, and while the teachers told us repeatedly that they would not teach us how to program, they made damn well sure we flunked out if we couldn't figure it out on our own. I turned out ok: http://sponeil.org/ - transeunte, on 10/12/2007, -0/+1"That article is horribly over exaggerating."
Amen. - yabos, on 10/12/2007, -0/+1Yeah that's a really easy problem and I hope most people would be able to program that.. However, I'm currently in SE 3rd year of a 4 year program and the number of people that can't program is rediculous. The ***** can't even debug an application. I basically have to do most of the coding in my group because they don't know what the hell they are doing. They don't know how to fix any problems by tracing with the debugger. They always just try and ask me what's wrong. Like I have nothing better to do than help them when they could do it in a few mins themselves. I guess you can probably tell that I really hate these people and I find the fact that they are so incompetent pretty rediculous. To top it off they are going for internships and while one of them got a pitiful 3 job offers out of 30+ interviews, another one got 10+ job offers with the same number of interviews. I'd hate to have to work with them in a production environment is all I can say.
- dougsnell, on 10/12/2007, -1/+7"Good programmers write good code, great programmers steal good code" ... but stealing code for the FizzBuzz example is taking that a bit too far.
At my company most of the "pure" programmers were replaced by off-shore people. The remainders are project managers who know enough about code to make it work when something is royally messed up. Altough a more in-depth study of FizzBuzz testing for companies who push off-shoring would be entertaining. - wbeavis, on 10/12/2007, -12/+6Why can't Web Servers... serve?
- Ibox, on 10/12/2007, -6/+1mirror??
- MasteRR, on 10/12/2007, -4/+3wow... what a simple test program, and people who are applying can't even do that?
Being as unskilled a coder as I consider myself I can do that in a number of languages in my head, even a few I have only basic knowledge in.
Maybe I should be applying for programming jobs after all. - foxhoundadmin, on 10/12/2007, -44/+7the REAL question is, "Why can't REAL programmers write... in ENGLISH!?"
i mean, really... c'mon, have you ever SEEN a programmer's writing in forums? it's 1/2 13375p34k, 1/2 dyslexia! how can somebody so smart, write so dumbly!?
you want to recruit a GOOD programmer? hire the applicant who couldn't write properly! :P- dragongrrl, on 10/12/2007, -1/+81real programmers don't write in leetspeak. that ***** is for script kiddies, foo.
seriously. - MasteRR, on 10/12/2007, -1/+14A lot of programmers are very bad and spelling and grammar in general, myself included. It is not uncommon at all.
Now leetspeak is out of the question for me, but I wouldn't deny misspelling variables and having poorly written output. - bpapa, on 10/12/2007, -2/+10I'm pretty sure the poor english writers are the international people.
But yes, I love when a forum has a post like -
"am trying to get the codes to compile. how to do this?" - billybob476, on 10/12/2007, -6/+9Funny, I consider myself to be a programmer who can program and I'm often told I'm quite eloquent.
- dbr_onix, on 10/12/2007, -0/+2You really don't need to be good at writing English to be good at coding.. Infact you don't need to know English at all to write code, but a large majority of forums and other websites are English only (Or the non-English sections aren't used much), so it makes more sense to ask questions and such in English, even if your terrible at it..
- dragongrrl, on 10/12/2007, -1/+81real programmers don't write in leetspeak. that ***** is for script kiddies, foo.
- NSMike, on 10/12/2007, -1/+31This guy is surprised that people who apply for jobs can't actually do the work they claim to be able to do?
He must not have very much experience hiring people. - Nougat, on 10/12/2007, -0/+8This applies to server admins, too. The problem is made worse by the fact that the people hiring server admins are all too often people who have no knowledge of IT.
- g0rdy, on 10/12/2007, -2/+0Exactly, doing a couple "How-To Forge" tutorials does not make one a server admin..
- dougmc, on 10/12/2007, -2/+3But you can be a somewhat competent server admin without doing any programming at all.
(Granted, you'll probably never progress past being a junior level admin without being able to program somewhat in at least some scripting language, but the job isn't really about programming, though of course some admins do make it all about programming.)
- mufasa, on 10/12/2007, -10/+2this reminds me of a weird bug i got in an app called MacDrive 6 earlier today. it's like 20MB when installed, yet it does'nt install all the features, so when i tried clicking on "partition mac harddrive" it said it needed a file called macdrive1033.msi, and it did'nt find it in the specified folder. when i pointed it to the file and clicked OK, it said the file was not valid. why could'nt it just install the whole ***** app right away ??
- dizzyedge, on 10/12/2007, -2/+4Yep..you'd be surprised how many people can't do the simple coding test we give them. We had to dumb it down and still can't find many people to finish it correctly. I'm appalled by how many senior developers can't write a single line of T-SQL
- DunderMifflin, on 10/12/2007, -2/+21Why? If you've never had to use Sql Server you would have no reason to learn or know a single line of TSQL. I've used Oracle for 7 years now and know Pl/SQL inside and out, however, I know very little TSQL. That doesn't make me inferior.
Programmers should be gaged on their ability to understand common software problems and the ability to solve them using logic and elegant solutions, not what language or syntax they know. - dizzyedge, on 10/12/2007, -1/+6Oh yea..we don't do that.
We always check on their resume if they've done work on SQL Server..cause that's all we use.
On our original test(the one I had to take)..they had to create a database/table/stored procedures..using the UI was fine too.
Then they create a very simple app to use the database they created. (Bonus points for DHTML)
Many couldn't even finish the database part.
To dumb it down..we created all the database objects for them..all they had to do is create the 1 page web app. I tell you..we still have trouble finding good people.
My point is that a lot of people lie about their experience & skills. - deabyss, on 10/12/2007, -1/+0I just give them a simple program to write in ML. If they can't code in a functional language, then their minds aren't twisted enough to work here! ;)
- vafada, on 10/12/2007, -0/+1senior developers needs to know TSQL? heck i have been programming for more than 5 years and very familiar PL/SQL, but don't know anything about TSQL. Does that make me a n00b? :)
- dizzyedge, on 10/12/2007, -0/+2@vafada
No..just don't put it on your resume if you don't know it.
I don't put PL/SQL on my resume - darkstar949, on 10/12/2007, -0/+2I work with SQL Server, but I don't know T-SQL and the simple reason is that I haven't had a need to learn much of it outside of the some extremely basic commands - the environment I work in requires me to use only standard SQL commands that are common to all platforms and I make do with that. Also, some companies have the database developers working separate from the application developers - the application might be competent with most of SQL Server, but they rely upon database developers to write T-SQL and triggers.
- dizzyedge, on 10/12/2007, -0/+1@darkstar Yea that's horrible..a some big companies do that. If that developer wants to go somewhere else..it's harder to find a job.
If they want to do consulting..forget it..people will laugh at him/her if they can't handle all aspects of an application. Some companies even want developers to do basic graphics work. - darkstar949, on 10/12/2007, -0/+2@dizzyedge - I honestly can't tell if you are being sarcastic or not - and a fact of programming that I have experienced based upon where I have worked is that some companies expect a small number of programmers (i.e. less than ten) to be familiar with all aspects of what is being developed, but if you head into an environment where programmers are segregated into specializations in such a way that you may not know everything. But then again this can be a good thing - there tends to be enough work in large applications that having people that are experts their area (i.e. databases, graphics, business logic) write streamlined code for that area.
- dizzyedge, on 10/12/2007, -0/+1No..wasn't being sarcastic...I guess it's different with web developers. Every place I've been in my 8 years as a developer..including some big companies...I was required to know & develop on all tiers of the application. I was required to do a lot of simple graphic work in only 1 place though.
- darkstar949, on 10/12/2007, -0/+2@dizzyedge - Yup, things are a bit different pretty much where ever you go, but to be fair web developers tend to live closer to the database than desktop application developers so they need to be more familiar with it.
- DunderMifflin, on 10/12/2007, -2/+21Why? If you've never had to use Sql Server you would have no reason to learn or know a single line of TSQL. I've used Oracle for 7 years now and know Pl/SQL inside and out, however, I know very little TSQL. That doesn't make me inferior.
- Laqrhead, on 10/12/2007, -6/+13http://www.duggmirror.com
- HellifIno, on 10/12/2007, -13/+12Post the whole mirror URL, so EVERYBODY can go there.
http://duggmirror.com/programming/Why_Can_t_Programmers_Program/ - clievers, on 10/12/2007, -1/+2you don't need to post the whole url, just duggmirror as it [usually] recognizes where you are coming from.
- jordanday, on 10/12/2007, -0/+2HellifIno, what do you mean "so everybody can go there"? I assumed duggmirror worked by looking at the referring url and redirected to the correct story? Why wouldn't clicking on the duggmirror.com link work for everyone?
I'm not being snarky, I'm honestly asking, what are the situations where that wouldn't work? - transeunte, on 10/12/2007, -0/+5@jordanday
If the user has disabled URL referral on his browser it won't work, hence the full address. - surfing, on 10/12/2007, -0/+2When I am at work, I need the full URL or it won't work (proxy server). At home it is not an issue.
- invader, on 10/12/2007, -0/+1some people disable their browser's transmission of the HTTP Referrer header, which duggmirror requires to automatically direct to the story you're coming from. I think the people who go out of their way to block that functionality should go ahead and just replace 'digg' with 'duggmirror' in their browser's location bar.
edit: forgot about proxies - HellifIno, on 10/12/2007, -0/+1Opera users regularly require the full URL. Not sure about other OS requirements, I just know that the "referrer" URL value is not good enough on many systems/browsers, just because they ignore the referrer.
And, in the end, I'm commenting on comments on an OLD story. Meh. Maybe you'll look back : )
- HellifIno, on 10/12/2007, -13/+12Post the whole mirror URL, so EVERYBODY can go there.
- ghostlywind, on 10/12/2007, -3/+16This must be why EA games never seem to work that well.
- opiv421, on 10/12/2007, -4/+1lol
- LittleDanzig, on 10/12/2007, -1/+9EA Games not working well really doesn't have much to do with the individual coders. It has a lot more to do with a ridiculously bloated corporate structure and a management hierarchy that tends to think throwing hundreds of people working 90 hour weeks at a project is the solution for every problem that may arise, and the fact that most of the development is based around timetables and not a standard of quality.
It's all 'Mythical Man Hour' stuff. The people doing the nuts-and-bolts work know their *****. They're just neutered by the machinations of a company that decided development and management was better handled by bean-counters and salesmen than by people who actually understand creating games.
- Quaoar, on 10/12/2007, -0/+12The essential problem with programming is that the programmer must have intrinsic understanding of the algorithms, etc., that are involved. So, for a fluid mechanics program like Fluent, one must have a basic understanding of the physics and the gridding algorithms as well. For an accounting program, accounting is a prerequisite. For a gaming program - the most intensive knowledge-based systems - whatever subsystem the programmer is working on, the programmer must have a decent grounding in that subsystem.
Programmers cannot program well unless they know something about the systems for which they program. BTW, I do not believe that ALL PROGRAMMERS ARE DEFICIENT! A small percentage might be bozos, but that is the same with any profession. (I am not a coder, but a chemical engineer. I have no dog in this fight.)
Q - TsarDusan, on 10/12/2007, -6/+4im first year at UofT for comp sci and i was practically required to be able to do that upon entry
- dougmc, on 10/12/2007, -1/+2I don't recall UT's computer science department requiring any knowledge of computers at all to join ... but things may have changed since I was there.
In any event, I think the entire article is less than honest, but it IS pretty easy to get used to doing a certain type of programming, and then having a really hard time going back to the basics in just a few minutes. It's also hard when they tell you to do it on paper, or on a blackboard, when you can't interactively debug your program like you normally do. Or maybe they were requiring that the simple programming job be done in a language that people may not be familiar with (if they asked me to do FizzBuzz in VB, I'd be stuck. I could probably work it out in Applesoft BASIC, but it's been decades so it would take me a while to get back into it.)
- dougmc, on 10/12/2007, -1/+2I don't recall UT's computer science department requiring any knowledge of computers at all to join ... but things may have changed since I was there.
- rledwich, on 10/12/2007, -0/+12I have seen many computer science undergrads who can not program. The problem is the students are interested but not interested enough to work outside of the classroom. I feel that out of classroom work, thus independent, allows the student to grasp the language and remember how the structures and keywords work. Also, I have noticed some computer science curriculum focus highly on theory and thus, the students do not see much programming after their first year.
I say nuts to the theory and focus on practical knowledge! As you develop the practical knowledge, the theory will make sense and in search of answers to harder problems you can learn more theory than you ever could in a classroom.- PopcornDave, on 10/12/2007, -0/+1You're exactly right. When I was at San Jose State back in the day we were learning asm on old VAX-11 machines, even though the 80386 was a fairly common machine. I understand teaching the theory, and basic ideas hold across languages, but there wasn't then or now a hell of a lot of call for VAX programmers.
Theory is fine, but if you don't do any real world programming to test the theory, what the hell good is the theory anyway?
Years later when I took a Perl class at a junior college, we had at least 2-3 programs every week to write, and as we got in to more complex areas we had less, but they were longer.
Theory and practice is the only way to fully understand what the hell you're doing in anything. - mlw4428, on 10/12/2007, -0/+6Agreed. I'm a CS major and I spend a lot of time coding outside of the classroom. Coding isn't just a future job to me but a hobby as well and I can tell the difference between people like me and those who've joined because they think it'll be a cool, easy way to make money. Many of the other students copy off of each other and just do some minor restructuring of the code.
Then again I'd like to believe there are a lot of others out there who love coding as much as I do.
- PopcornDave, on 10/12/2007, -0/+1You're exactly right. When I was at San Jose State back in the day we were learning asm on old VAX-11 machines, even though the 80386 was a fairly common machine. I understand teaching the theory, and basic ideas hold across languages, but there wasn't then or now a hell of a lot of call for VAX programmers.
- CaptMonkey, on 10/12/2007, -0/+1Old news to me. And if you think it's bad in the corporate world, you should have seen the guys I worked with when I was in the military. A couple of them were some of the smartest people I know, the rest... not so much.
- sio2man, on 10/12/2007, -1/+5Sounds like the difference between a programmer and a software engineer...
- stankyfish, on 10/12/2007, -5/+1IMO, a programmer implements a design, a software engineer comes up with the design. I'd say the difference is design vs. implementation.
- h00paj00, on 10/12/2007, -1/+6I blame those late night local pseudo colleges (you know, the ones that cater towards ex-crack heads and giggly girls that say "i never paid attention in high school, and I got a college diploma!") that teach people "Computers!" and "Information Technology"
They probably have an entire semester dedicated to "Hello World". - BigBaRay, on 10/12/2007, -14/+8LOL... Could it be that the fact that most people coming out of school with CS degrees know more about being a SOCIALIST than a programmer?
(sry political comment in non political section, I couldn't resist)
Those who can not do... TEACH.. Especially in the CS field.- LittleDanzig, on 10/12/2007, -0/+7>That tells you whats wrong with politics that you need a ivy league degree to get anywhere in politics. Hopefully the internet revolutionizes school.
(waiting for the day when education is free over the net, and a degree is supplied by a free nationwide testing center system)
Sounds like some "famous Marxist thought" to me. - deabyss, on 10/12/2007, -0/+2@LittleDanzig
Don't know why you were dug down, but you spotted some very sweet irony.
- LittleDanzig, on 10/12/2007, -0/+7>That tells you whats wrong with politics that you need a ivy league degree to get anywhere in politics. Hopefully the internet revolutionizes school.
- bluechips23, on 10/12/2007, -3/+1I think they should come to my college. They will get plenty of hard core programmers.
- HellifIno, on 10/12/2007, -1/+3Yeah, and EVERYBODY in the world knows where/what your college is. Like, instinctively.
- soulfire, on 10/12/2007, -6/+2I switched out of Computer Science after a year and a half and fizz buzz looks pretty simple.
Here is the pseudo code for it.
for(int i =1; i- soulfire, on 10/12/2007, -5/+2Digg didn't record all of my comment wtf.
for(int i = 1; i - digitalsin, on 10/12/2007, -3/+4excuses excuses....
;) - tont0r, on 10/12/2007, -0/+9Here is a nice programming lesson for web apps:
If you are allowing users to enter input, do not allow them to use the greater than sign or less than sign, along with a few choice others :P - BigBaRay, on 10/12/2007, -1/+3I think what soulfire wrote will actually work with some browsers. If not blame it on Microsoft and wait for a patch. Or better yet out-source it to India for a solution.
I am starting my own outsorce software dev firm of the coast of India on a clump of land known as FUBAR islands. any one need any work done? $10 hour no specs required (we have no intention of giving you what you want anyway) - Scarblac, on 10/12/2007, -0/+1Besides not realizing that < is a problem in HTML posts, you miss two points: firstly, that the entire point of this whole article is that FizzBuzz is _dead simple_, not just quite simple; and secondly, that pseudo code isn't enough, the point is to write it down correctly in whatever language you're claiming to know in your resume.
- soulfire, on 10/12/2007, -5/+2Digg didn't record all of my comment wtf.
- fastawdtsi, on 10/12/2007, -6/+1FizzBuzz.go();
- combustion8, on 10/12/2007, -7/+2As long as you know the structure who gives a damn if you copy and paste? its all about being efficient... I'm an actionscript coder and if I dont have to waste time typing out every single symbol why should I?
My boss only cares about end results as do ALL bosses. - josephhallett, on 10/12/2007, -9/+1Well... I'm a first year engineering student (specialising in Aero). I've done a little C, so lets see.
#include
main() {
int count;
for(count = 1; count- soulfire, on 10/12/2007, -3/+2Did it not record your next line? Same thing happened to me
- josephhallett, on 10/12/2007, -4/+2argh didn't all appear!
Typical can do what 1 in 200 coders can't, but can't manage a simple DIgg comment. Foiled again.
Oh well it worked and took 3 minutes, to write, compile, and be shown to work. - fastawdtsi, on 10/12/2007, -2/+4I think it's looking for an HTML tag after you less-than sign...
- bledbetter, on 10/12/2007, -2/+21This makes perfect sense to me. 99% of managers can't MANAGE, either.
What is this country coming to?- combustion8, on 10/12/2007, -0/+5this is true.
- zmigliozzi, on 10/12/2007, -1/+1pretty sad. thats basic of basic programming skills.
- sprintmarathon, on 10/12/2007, -0/+9Depending on the methodology used to administer these tests, It's possible that the best programmers could even be weeded out by such practices. Not because they can't solve the problem, but because they're being placed in a hostile scenario that subjects them to evaluation in an overly harsh and simplistic way. Despite their highly developed abilities with software development, many are not psychologically equipped to deal with such a scenario and would simply freeze. The best programmers that I've ever known are all brilliant individuals, but each is so highly eccentric that when forced to perform other seemingly simple tasks – like interfacing with clients, or staying awake for an entire 8 hour day – they fall flat on their face.
While this testing methodology might work for weeding down the masses to one or two candidates that are worth their salt, it's asking too much to think that this is a suitable test for say, a PhD.- tizz66, on 10/12/2007, -0/+1Surely if you are interviewing job applications, you want the ones that can talk to clients and stay awake? :|
- tony23, on 10/12/2007, -0/+1"many are not psychologically equipped to deal with such a scenario and would simply freeze"
If you can't handle that sort of scenario, then how the hell are you going to handle the pressure of a deadline looming for a release TOMORROW?
- hilbertspaceboy, on 10/12/2007, -1/+1I find it hard to believe that there are many college graduates out there that can't write a loop or count in hexadecimal.
I think Dan Kegel is exaggerating.- zoom1928, on 10/12/2007, -1/+3I had nine interns that were seniors in CS work on a simple program for six weeks that they didn't complete. It simply read addresses from an SQL database did a little processing then wrote them back to another with a different schema. I gave them examples of every individual piece they would need. They worked 20 hours a week so their total effort was 1,080 man hours for a program that was about 90% complete, but it only took me 20 minutes. That means I'm over 3,000 times more productive. Even working together they couldn't get for loops to work correctly. They still had a fencepost error.
Just wait until you get out in the real world and have to hire programmers to help you with a project. I've been through nine degreed programmers before I finally found a 19 year-old high school drop-out that could program well. Even two graduates from GA Tech didn't completely understand the purpose of the three semicolons at the top of the for loop. The sad thing is they all expected $55k/year to do nothing. And we wonder why the US can't compete.
- zoom1928, on 10/12/2007, -1/+3I had nine interns that were seniors in CS work on a simple program for six weeks that they didn't complete. It simply read addresses from an SQL database did a little processing then wrote them back to another with a different schema. I gave them examples of every individual piece they would need. They worked 20 hours a week so their total effort was 1,080 man hours for a program that was about 90% complete, but it only took me 20 minutes. That means I'm over 3,000 times more productive. Even working together they couldn't get for loops to work correctly. They still had a fencepost error.
- stinkypyper, on 10/12/2007, -0/+3I call ***** on this article. I could write a basic program on my C64 when I was 12 that could do that fizz-buzz problem. That guy is exaggerating.
- VTmruhlin, on 10/12/2007, -2/+4Dude, I had to debug the following piece of c++ once.....
int i=0;
for( ; ; ){
//make sure character i is valid....
i++;
if(i > 4)
break;
}
They're out there. I hope, for your sake, that you don't meet them. - HellifIno, on 10/12/2007, -0/+2... I really hope your code was digg-raped. It made NO sense otherwise. : /
Then again, maybe that was the point. Hmm. - VTmruhlin, on 10/12/2007, -0/+3I assure you, that's the code. Well, the comment in the middle is substituting a large block of irrelevant (but equally bad) code.
I mean, the whole idea was that it would prevent a user from setting their PIN as "1234" or "4321", etc; and the guys screwed that up.... - gboodhoo, on 10/12/2007, -0/+0totally agreed. Maybe I'm just fortunate to have worked with excellent programmers on interesting tasks. Maybe the guys working for insurance companies or banks (or something equally tedious) really are this dense. But I doubt it. Seconding the call for bs
- VTmruhlin, on 10/12/2007, -2/+4Dude, I had to debug the following piece of c++ once.....
- austindkelly, on 10/12/2007, -3/+399% of articles writen on the internet are *****...
- Urusai, on 10/12/2007, -6/+14I'm rusty, isn't programming something like
_main:
LDS SI,$MESSAGE
MOV AX,0xC800
PUSH AX
POP ES
XOR DI,DI
REP MOVSB- Klowner, on 10/12/2007, -0/+5If you choose to use assembly, it is remarkably exactly like that..
- fastawdtsi, on 10/12/2007, -0/+1What's in CX? ;-)
- Fulvian, on 10/12/2007, -3/+0Yea many programmers can't write code, because it's not necessary and just wasting their time, they're supposed to type code. You know that only typed codes can be compiled, the written ones can't.pb
- int3, on 10/12/2007, -3/+5Check out this sierpinski fractal I wrote in Turbo Assembler about 7 years ago. This version assembles to 35 bytes. I have a 31 byte version somewhere as well, but I can't find it right now :).
_TEXT SEGMENT BYTE PUBLIC 'CODE'
ASSUME CS:_TEXT, DS:_TEXT, SS:_TEXT
ORG 100h
.386
START: mov al,13h
int 10h
push 0a000h
pop ds
; Init Complete.
mov di,159 +(320*150)
mov word ptr ds:[di],di
dec di
; inc byte ptr ds:[159 + di]
@@Main: mov al,[di + 319]
xor al,[di + 321]
mov byte ptr [di],al
dec di
jnz @@Main
int 16h
; DeInit Follows.
mov ax,3 ;
int 10h ; it is filled with scan code from
; int 16h. (Extra Byte)
ret
_TEXT ENDS
END START
END - int3, on 10/12/2007, -3/+4Ultra-small 27 byte version :D. Relies on registers being in a certain state when launched by DOS/Windows for COM executables.
.model tiny
CODESEG
STARTUPCODE
lds si,[bx]
mov al,13h ; initialise graphics mode:
int 10h ; 320x200x256 at 0xa000
; Do the triangle
push ds
pop si
looper: xor al,[si] ; Initially assumes al=0. Ok?
mov [si-319],al
mov al,[si]
dec si
jnz looper
int 16h ; keystroke? ah is already 0
; Tidy up
mov ax,3 ; return from graphics mode,
int 10h ; back to text
ret
ENDS
END - WileEPeyote, on 10/12/2007, -0/+2Don't know why you are getting dugg down. Maybe not enough people realize that your aren't just typing random characters.
- int3, on 10/12/2007, -0/+2Yeah, that is odd. Maybe too many VBA coders got a tinge of jealousy? :)
I work for a games company in a lead capacity. One skill that has helped me greatly (and that of anyone else who knows it) is assembler (both for x86 and PPC - we do 360 dev). If your C++/C code is crashing in insane ways (and it can do on very large projects), dipping into the assembler to diagnose the problem (such as unwinding callstacks by hand) is very handy. Of course this doesn't really matter if you're doing Java or C# all day, but in my line of work it really helps to know your onions. - MotionAesthetic, on 10/12/2007, -0/+5The game Rollercoaster Tycoon was almost entirely programmed in assembly - by one guy.
That blew my mind.
- mrsark, on 10/12/2007, -6/+1owned
- StarManta, on 10/12/2007, -0/+10I love everyone trying to write in the comments their code for fizzbuzz and getting owned by the less-than sign. :)
- bryan986, on 10/12/2007, -0/+3Less than? < ftw!
& lt; (without the space)
Unfortunately it becomes the less than size again when you try to edit. - tybris, on 10/12/2007, -0/+1While there's really not that much shame in using !=
- StarManta, on 10/12/2007, -0/+2But then, you'll get something like:
http://www.digg.com/software/How_to_crash_an_in_flight_entertainment_system_2
- bryan986, on 10/12/2007, -0/+3Less than? < ftw!
- Treius, on 10/12/2007, -0/+2Having been a former CS student (I'm now an IT student) I've got to say that it's true that the majority of study is spent on concepts and learning to think. If they taught actual programming languages they'd be useless before you graduated. Hell I started learning CS in C++ and when I left the new standard was Java. The best thing you can get is the ability to learn new things, if you can pull that you're golden.
- digitalsin, on 10/12/2007, -4/+21It really all boils down to the fact that, as I see it, there are two types of us programmers.
Type 1: Career Programmer
This is the guy who, when asked what his job is, he says "programming". When you ask what he does in his spare time, he might reply with "I bungee jump, party, get drunk, party, etc etc". Programming is strictly a job, and when he comes home he might not even have a computer. Or he has a computer that is basically used for accessing MySpace. This is the guy FizzBuzz trips up, and he sees no value in it.
Type 2: The "Programming is an Art / Science" Programmer
When you ask this guy what his job is, he'll say "programming". Ask him what he does in his spare time, he might reply with "Well I just finished skimming through the Rails Recipes book. I use .NET at 'work', but I like to learn new languages and technologies when I have some extra time. Oh, I also spend my extra time keeping my blog on .NET Tips & Tricks up to date! By the way, have you read Getting Real by 37signals? It has some great ideas.".
You see, Type 2 is not just a programmer from 9 to 5, he really enjoys what he does and makes it his passion. He's also not simply a person who just likes to bang out code and go home. He takes the initiative to learn new languages. He reads books about the SDLC and methodologies.
This is the guy you want if you want quality. He excels in smaller environments. He's not simply a body filling a position. To find Type 2, ask the candidate what books he's read related to his profession in the last year or so. Ask what tech sites he visits, and why.
Even if Type 2 doesn't get fizzbuzz right off the bat, it's fine. Because he'll take the initiative to figure out the problem on his own time through his various forum resources. Most problems we, as developers, get are unique in some way and require detective work. Are you hiring someone who can be a detective and find a solution, or are you testing them to see if they're a walking reference book on a single framework but lacks the ability to think outside the box?- MikeD606, on 10/12/2007, -4/+7I dont think its that simple. I dont code outside of work, does that make me a bad programmer? NO
Sorry, I'd rather play xbox, wii, or hang out with friends than code after 40 hours of work. - tont0r, on 10/12/2007, -7/+3yeah, because we all know that someone who programs in his/her spare time never go to a party or get drunk.
- digitalsin, on 10/12/2007, -2/+4@tont0r: Job well done for a point missed. Pat yourself on the back buddy.
- h00paj00, on 10/12/2007, -0/+6I used to be Type 2...
Then I hit 30, got married, and I'm happy to just plug along as a type 1 and get away from my computer when not "at work" - tont0r, on 10/12/2007, -0/+3no you are missing the point. Its not black/white. You can do non-programming things outside of work and still be a good programmer. Its different when you go home to your cat and you have free time. Get people how go home to a wife/kids/gf/other ***** they need to do, they arent going to be programming much when they get home.
- digitalsin, on 10/12/2007, -0/+2I was not saying that programmers should have no life outside of work. I have a wife and 2 kids, I certainly know that they get priority when I come home. However, I make it a point to set some time aside for reading, learning something knew, trying something out, etc. If you think programming is an art, you'll agree that an art cannot be mastered from 9 to 5, 5 days out of a week. It's what separates merely good or mediocre programmers from excellent programmers skilled in a diverse range of things. Those are the people I want to hire and surround myself with. You only grow by surrounding yourself with people better than yourself.
The point was that Type 1 views programming as simply a job, nothing more. Type 2 sees it as more than a job, he loves doing what he does. You bring pictures of your wife or significant others to work - you love them. You don't leave work purely at work if you love it - it comes home. And the better you are for it in your chosen field.- tehtuxpenguin, on 10/10/2007, -0/+0I agree with you. Type 1 does not have passion in programming. But Type 2 does.
- PedleZelnip, on 10/12/2007, -0/+13This is one of the most common misconceptions I hear all the time amongst collegues about programmers about what makes a "good" programmer. In my experience type 2 tends to be the stereotypical antisocial computer "geek" who is standoffish, and writes code that is wildly effecient but horribly difficult to maintain and that tends to be viewed as "good enough". They often have difficulty working with others, and just tend to "do things themselves". They have little balance in their lives. Often reacts with hostility to criticisms.
I think there's also a type #3: the programmer who enjoys being challenged with new problems, and while he/she doesn't read an O'Reilley book or learn a new programming language every week, he/she isn't afraid to broaden his/her horizons. He/she loves programming but often has varied interests away from computing (perhaps has a wife/husband and family). Because of the balance in his/her life, he/she is often able to interact well with others. Takes pride in his/her work, and often while not a prolific code writer, produces code of the highest quality and is always looking to improve his/her code even further. Is willing to accept criticism. Puts an emphasis on dividing a problem into smaller divisible tasks and has no reservations about handing them out to others.
I think it's type #3 that is the ideal programmer, yet it's type #3 that will tend to be hurt by the common types of obscure questions that are asked in programming job interviews (What's the operator in C++? What's call by value-result semantics? What's your favourite data structure?)
Programming skill has little to do with acquired knowledge, but rather the ability to problem solve and think critically. Yes you need familiarity with the language in question, but if you cannot break a problem into manageable chunks then you'll never come up with a great solution to it irregardless of how familiar you are with the language. - darkstar949, on 10/12/2007, -0/+1I think you are confusing what a career programmer is - a good career programmer (i.e. someone that plans on spending 20+ years in industry) knows when to walk away from the code for awhile and take a break and manage to enjoy life without programming being the only thing they do. These are the programmers that end up being the seasoned "old salts" because they knew how to balance life and code and didn't burn out and find a different career path once they hit their 30's. The type two in your group tend to be the guys that burn out and stop coding at some point - they pour so much time in to code that one day they just don't want to do it any more.
- sketchydave, on 10/12/2007, -0/+3I think you're on about the 2 types of programmers, but one is not necessarily better than the other and we're looking at the too "extremes" of the industry.
Programmer #1 is more likely to specialize. He or she will know a few core languages, and know them well. They will crank out useful, working code, quickly. Most people are closer to programmer #1 than #2
Programmer #2 is less likely to specialize because he or she are more fascinated with the topic. They will learn about a multitude of skills, but never be a specialist because its too confining.
In 20 years Programmer #1 is likely to be still coding or consulting and doing well at it. I would venture that Programmer #2 is now a teacher at a University. And if not they should be as it is an outlet to share their passion with up and coming programmers and they have a wealth of knowledge to share. - Scarblac, on 10/12/2007, -0/+1This is too black and white. Yes, programmers who never do anything about their skills outside of work are generally pretty bad. That doesn't mean the good ones do programming all the time.
What you're missing in between your "carreer programmer" and the "programming is an art" guy, is the _professional_ programmer. Who tries to improve his skill by reading books and learning new things, because he wants to be the best he can be at his job.
I read a lot of those, but I wouldn't call it a hobby - chess is a hobby, sport is a hobby, my girlfriend takes a lot of my spare time. Those books, they're professional development. - ZergyPoo, on 10/12/2007, -0/+0"Yes, programmers who never do anything about their skills outside of work are generally pretty bad."
I beg to differ. This doesn't mean anything.
A lot of good jobs will give people time during work to do research, figure out new things, whatever. Just because I don't strive to learn things outside of work, doesn't mean I don't strive to learn things. - CamperBob, on 10/12/2007, -0/+0Then there are people like me, who have an optimal FizzBuzz implementation that this comment box is unfortunately too small to contain.
- MikeD606, on 10/12/2007, -4/+7I dont think its that simple. I dont code outside of work, does that make me a bad programmer? NO
- GoneSouth, on 10/12/2007, -1/+1Oh, this is a subject near to my heart. It is true. Well, 199 out of 200 is hyperbolic - my personal experience is that probably 25% of the programmers I've worked with, cannot go from requirements to working code in a relatively independent fashion. The rest do not understand basic programming concepts (whats a depth first search?), don't understand basic oo concepts (they use large case statements instead of polymorphism), cant' debug (read a stack trace or set up a debugger), and can't reseach / pick up new skills independently (like, read a tutorial on the Internet).
I blame this on substandard eduction and hiring practices. Community colleges, foreign colleges, and programmers with a degree in a marginally related field (i.e., mechanical engineer turned programmer) are all red flags for me. In order to weed these folks out in the hiring process, you simply cannot trust resumes. You need to literally have them develop a software system, starting from requirements, on paper and have them show their work each step of the way. This is a lot of work, but its a lot less work than supporting an unproductive programmer.- TroubleInMind, on 10/12/2007, -0/+1That's not very agile.
- deadbaby, on 10/12/2007, -0/+6He's interviewing VBA guys? That's your problem right there. You have to seriously question the talent and knowledge of anyone who wants a programming career in VBA.
- LowRentDiggs, on 10/12/2007, -2/+5What a great way to start the day. I type a few if statements in under 2 minutes and find out I am better than 99.5% of programmers :D
- Topher06, on 10/12/2007, -0/+4Its simply because about 10 years ago, programming was the golden job. You could go to Devry, spend 6 months learning VB, get a diploma (a piece of paper that had DeVry and your name and something that looked like an official stamp), and then got a job paying 90k in which they simply retrained you anyways. It was the get rich quick scheme of the 90's, put a little bit of effort into education, get a high paying job because companies were crazy about programmers. Companies were hiring studends out of high school because they couldn't get enough people with the "potential" to program. I don't know how many civil engineers, marine biologists, and liberal arts majors ended up getting "programming" jobs when I was leaving university, stupid me wasting 4 years on a comp-sci degree.
Then the dot.com bubble burst and what companies survived realized they don't need 100 unskilled and untrained programmers in house when they can get 100 unskilled programmers overseas for 1/10th of the cost.
What's left is a market flooded with unemployeed people with non-IT related degrees who still think that companies want to hire people, pay them 100k and train them to become programmers. That or their 6 month Devry degree is all they need to land a job requiring 5 - 10 years experience. So every programming position gets hundreds of applications from non-programmers.
Programmesr CAN program, just that people are calling themselves programmers when they can't code.
BTW, the golden job at the moment is web/graphics designers. Millions of people who know a little about HTML and photoshop hoping to land 100k jobs designing Web 2.0 sites. - opiv421, on 10/12/2007, -0/+2I was a CS major my first year. This is probably different in other universities but the problem I noticed was that in our exercises we were given a piece of paper or a file with almost finished code and we would have to write whatever was missing and possibly a few test cases to make sure everything ran smooth. The problem with this is that when your given a blank screen or piece of paper and asked to write entire code, even for a relatively simple program, people just don't even know where to begin.
- Negligence, on 10/12/2007, -0/+2You had it pretty easy, then :)
In a data structures class, for all tests and exams, we had to write (by hand) binary tree methods, graphing and sorting routines, and the list goes on. It was very frustrating and extremely difficult. You had to know exactly how everything worked, otherwise you were writing empty methods. I barely made it through. - tyywebb, on 10/12/2007, -0/+1Oh man If I had to do that I'd be screwed! I'm taking data structs right now and I am a little worried cuz I'm one of the smarter kids in the class but I'm not that smart! I even had to type out the fizz buzz thing just to make sure I could do it!
- Negligence, on 10/12/2007, -0/+2You had it pretty easy, then :)
- headzoo, on 10/12/2007, -0/+2"A surprisingly large fraction of applicants, even those with masters' degrees and PhDs in computer science, fail during interviews"
Then stop looking for people with college degrees, and start looking for computer geeks who love coding. God knows how many people get degrees in fields they aren't qualified for, or at heart they really have no interest. If you want to find someone who is really interested in programming, then find a programmer. A programmer doesn't have to have a college degree. - leighj, on 10/12/2007, -0/+1I actually helped a guy get his CS degree writing basically what I learned in high school. And the work was EXTREMELY simple. But the professor didn't teach them anything. Not that he didn't hold class. He just didn't know the material himself. I once knew a project manager (who would ALWAYS offer/force technical designs and programming methods he would come up with) when asked what the closest star to the earth was he replied "Does the Moon count?"
BUT he had a MASTERS and had worked at big tech engineering company so I had to endure him...- beijingdave, on 10/12/2007, -0/+1I've been on numerous projects where a person with a CS masters degree claims superiority yet the art-major turned self-taught programmer runs circles around him in terms of applying good design patterns and general productivity.
I find that the CS major is usually only good at specific, well defined and documented tasks where self-taught programmers seem to see the bigger picture and take the initiative. But maybe this is all just anecdotal. - tybris, on 10/12/2007, -2/+1@beijingdave
Real computer scientists hate design patterns. They're technologically irrelevant and obfuscate the inner workings.
- beijingdave, on 10/12/2007, -0/+1I've been on numerous projects where a person with a CS masters degree claims superiority yet the art-major turned self-taught programmer runs circles around him in terms of applying good design patterns and general productivity.
- TroubleInMind, on 10/12/2007, -0/+2I assume it's an exaggeration to say 199 out of 200 cannot write FizzBuzz. I think that's a safe assumption. Right? I think most people I hang with can write FizzBuzz in less than 20 lines of code, probably in more than one language.
Having said that, I have been put on the spot in interviews and come up with a completely blank mind when asked to write code. On the way home, I think of five ways to do it. On the hot seat, not so easy. I never ask people to write code on the spot. It's not a fair gauge of their ability. - martypal2005, on 10/12/2007, -1/+2Don't expect someone to know API's and SDK's by heart. This is very uncommon.
Seems like the misconseption here is that you should be able to write an application from scratch on paper.
This is not the 70's. Most applications today build on other "building blocks".
As far as I'm concerned the biggest challenge for any application developer is to be able to rapidly develop prototypes on new API's. Where I work I get these requests quite often from our team manager and I have to wrap something out in a couple of days. I steal as much code as possible and write my own where needed. This is how everybody does it. If you think it's not moral or ethical then perhaps you should go consolidate with your team manager and tell him you need a week more so you can read up on some specific topic. You will be fired.
Yes I use google. No I don't look it up in the C++ reference books, simply because I don't have time. Agile development.- greyfade, on 10/12/2007, -0/+2No one is talking about APIs. No one can be expected to know the API du jour for a particular job. TFA talks about basic programming concepts like loops and recursion.
- crimson117, on 10/12/2007, -0/+2Still, a verbal discussion about when to use loops and recursion is much more valuable than writing out code on a chalkboard like you're in high school. Who knows - the interviewee may have just memorized a mergesort function in C++ 15 minutes before the interview. But would he know when to use it?
I'd rather hear about the programming solution the candidate was most proud of. Depending on complexity, elegance, etc of his/her answer, I'd learn much more about how he'll fare in a job than by watching him/her scratch out some code.
- VTmruhlin, on 10/12/2007, -0/+1I had an interview where the guy wanted to "make sure I knew OOP", so he was asking me these really basic questions, like "What's the difference between a class and an interface?", "What's polymorphism?". I was kind of stricken by why he would ask me such obvious stuff. Maybe there are people who DON'T know that stuff?
/ On the converse, I've heard of a manager handing out written instructions....
"Write a program that prints the following:
1
23
456
7890."
then criticizes people because his spec mentioned that it had a period at the end.- MikeD606, on 10/12/2007, -0/+0Well it is good to know OOP and I don't think there's anything wrong with him asking you about basic programming concepts.
- TroubleInMind, on 10/12/2007, -0/+5The period issue is a valid criticism. The spec says it has a period. Omitting it is a failure. Arguments about whether the spec has a typo are irrelevant.
Award two points if applicant asks about the period before beginning work (shows an eye for suspicious data in spec doc)
Award one point if applicant does it with period intact
Award zero points for any other answer - dougmc, on 10/12/2007, -0/+2`I was kind of stricken by why he would ask me such obvious stuff. Maybe there are people who DON'T know that stuff?'
There are. There are even good OO programmers who don't know the terms.
Or other languages that are OO that use different terms.
- Luuvitonen, on 10/12/2007, -0/+2Reminds me of the Guerilla Guide to Interviewing by Joel Spolsky: http://www.joelonsoftware.com/articles/GuerrillaInterviewing3.html
Recursion is your friend. - greyfade, on 10/12/2007, -7/+1Fizzbuzz solution in Perl (for Ruby solution, remove $s):
$i = 0;
do {
print 'Fizz' if ($i%3 == 0);
print 'Buzz' if ($i%5 == 0);
$i++; print "\n";
} until ($i > 100);
And a note about recursion: I've used some form of recursion in nearly every programming language I've ever used, and I find that understanding it is critical to being able to work with any form of complex data structure - like graphs. The fact that there are CS grads who can't grasp such an elementary concept sickens me to my core. Even college-level Algebra students should have a firm grasp on recursion - at the very least how it works.- tont0r, on 10/12/2007, -6/+0digg down
- psylence, on 10/12/2007, -0/+9Man, the great part about your post is that your code fails the case mentioned in the first damn sentence.
- DerGeist, on 10/12/2007, -1/+3Good job spanky, except that prints blank lines where the numbers should go.
Your program doesn't do the most basic part of the assignment.
YOU FAILED IT - tont0r, on 10/12/2007, -6/+0He will still hit the i%3==0 and i%5==0 since he is using print statements and not print "n". But you are right, it will print lots of unncessary newlines.
- Quadduc, on 10/12/2007, -0/+1And it should start with i = 1.
- postitnote, on 10/12/2007, -4/+1Bah bury me.
- skidooer, on 10/12/2007, -2/+2Am I hired?
f='Fizz';b='Buzz';1.upto(100){|i|puts(i%3==0&&i%5==0?f+b:i%3==0?f:i%5==0?b:i)} - gromnie, on 10/12/2007, -0/+1Too long typing. Addressed already.
- phill, on 10/12/2007, -0/+1I've been learning Ruby and I've got to say that I really like it.
f = 'Fizz'
b = 'Buzz'
1.upto(100) do |i|
puts i%3==0 && i%5==0 ? f+b : i%3==0 ? f : i%5==0 ? b : i
end
-
Show 51 - 100 of 198 discussions
