Why can't programmers... Program?

15    25 May 2016 04:08 by u/Omnipresent

65 comments

9

Part of the problem is that the industry is focused around too many tools. If you don't know somebody's specific framework you are scoffed at. Back when I started we didn't have frameworks, we had libraries. They were tools that weren't supposed to take over your entire project. There being one or two or five frameworks is fine. When there is now 40 and you are expected to combine them we are spending more time structuring projects than building and we are starting to loose are skills.

Also that fizbuzz is easy. People who can't do that are people who were patted on the back to many often for learning a framework.

0

Also that fizbuzz is easy. People who can't do that are people who were patted on the back to many often for learning a framework.

This is pretty much the point of FizzBuzz. It's not to find the great programmers, but to weed out all the idiots who choke up on even the most trivial problems. If it weren't so easy, it'd be useless.

0

Well if you don't have 5 years experience in the obscure 3rd party framework the previous dev chose for the project because we gave them too much creative leeway and now regret it but can't go back, you probably aren't a good fit for this position.

6

Python FizzBuzz

def fizzbuzzer(n):
    if n % 3 == 0 and n % 5 == 0:
        return "FizzBuzz"
    elif n % 3 == 0:
        return "Fizz"
    elif n % 5 == 0:
        return "Buzz"
    else:
        return n
nums = list(range(1, 100))
for i in range(0, len(nums)):
    print(fizzbuzzer(nums[i]))

I have learned Python entirely on my own time. I think this took me about 10 minutes, maybe less, wasn't really counting.

1

This was indeed the first solution that popped in my head when I was reading the article. We can get jobs now!

3

it's almost ok, Biggest problem is that it doesn't do what it should, it only prints 1-99 not 1-100.

To fix that change from range(1, 100) to range(1, 101)

Second (not so big) problem is that it makes 0 sense to have this nums variable, the same result you will get from:

for i in range(1, 101):
    print(fizzbuzzer(i))

I probably wouldn't hire you as a Python programmer :P

0

derp

1

Javascript (ES6) version:

let fizzbuzz = function(n) {
  let mod_3 = n % 3 === 0, mod_5 = n % 5 === 0; // I just don't want to have to rewrite the modulus logic more than I have to
  if (mod_3 && mod_5) return "FizzBuzz";
  else if (mod_3) return "Fizz";
  else if (mod_5) return "Buzz";
  else return n;
}
for (let i = 1; i <= 100; i++) {
  console.log(fizzbuzz(i));
}
1

The Human Resource safe C# version would be this:


        private static string GetResult1(int ix)
        {
            var isFizz = (ix%3) == 0;
            var isBuzz = (ix%5) == 0;
            if (isFizz && isBuzz) return "FizzBuzz";
            if (isFizz) return "Fizz";
            if (isBuzz) return "Buzz";
            return ix.ToString();
        }

But of course if you are a bit of professional you would create something like this which would fail the Human Resource test and you are not selected

        private static string GetResult3(int ix)
        {
            var isFizz = (ix % 3) == 0;
            var isBuzz = (ix % 5) == 0;
            if (!isFizz && !isBuzz) return ix.ToString();
            if (isFizz && !isBuzz) return "Fizz";
            if (!isFizz) return "Buzz";
            return "FizzBuzz";
        }

Why did I write it like this?

  • Numbers are more likely to be returned than Fizz of Buzz
  • Fizz is more likely be returned than Buzz
  • Buzz is more likely returned than FizzBuzz
  • Usage of "&&" is more compiler efficient
4

People generally rely on the higher education system, rather than teaching themselves. Save for certain institutions, the higher education system is decades out of the loop.

3

O...M...G....
Programming is not even my forté, but I can damn well program you an embedded system that can read/write digital/analog....
but ask me to build you an AFE... you better offer well because I will be hating myself if you don't let me use a developer board.

2

I like to think most of these are just people applying to any kind of job ad where they might be able to talk/con their way into a paycheck, but for people who have done a CS degree, not learned to program, and then applied for a job as a programmer... if they are real... I'd love to hear from one and understand what they thought a programming job would entail, and what they plan to do with their lives.

2
0

Contributor Code of Conduct

I'm laughing already.

1

I write multi-threaded C++ for a living and the first time I was asked to solve the FizzBuzz problem I could not do it. Not because the intricacies of modulo are beyond me, but because I come from a country where we don't play FizzBuzz and had no idea what the problem was. Before you blame the programmer, make sure your specification doesn't suck!

Having said that, an amazing number of people seem to think they can bs their way through quantitative development job.

1

Are you sure the problem is with not knowing what Fizz-Buzz is? I don't know what it is, either, and I can write the code for it.

void main (){ for (int i=1; i <101; i++){ if (i%3!=0 && i%5!=0) cout << i; else { if (i%3==0) cout << "fizz"; if (i%5==0) cout << "buzz"; } } }

0

Yes, you can write that because you have a description of the rules of FizzBuzz. Given only the name FizzBuzz you could not have implemented it. It is certainly an extreme example, but we all have a tendency to think that what we know is common knowledge.

0

From the article: An example of a Fizz-Buzz question is the following:

Write a program that prints the numbers from 1 to 100. But for multiples of three print "Fizz" instead of the number and for the multiples of five print "Buzz". For numbers which are multiples of both three and five print "FizzBuzz".

It seems like they would give the rules in the question. The name Fizz-Buzz is just that, a name.

3

The hardest part of the job is often trying to understand what the user/boss/client actually wants.

0

And decoding that to figure out what they really should want. Then convince them of why your solution is better than their solution.

1

My team has been trying to hire 3 software engineers for 6 months now.

Nowadays, recruiting is generally pretty good not getting people who literally can't write any code to the on-site interview phase... But I wouldn't have believed it until I lived it.

1

I'm currently attending a school for game programming. I'm already in my 2/3rd year. As of now, I know 100% that once I graduate I will not get a job anywhere. I have come to the conclusion that my school is barely teaching us anything.

I've been doing a lot of research on the internet. I have accumulated some hope in regards to getting a job without a degree. My program will only give me an advanced diploma. I've been told that my chances of being selected are lower than CS student. But by researching more and more on Google and reading people's comments and those who work in the industry I've come to realize that the most important thing, the hiring manager is a complete idiot who doesn't know anything about programming and only looks to see what school you applied to, is your value. You can go to the most prestigious school in the world but in the end, except for a few cases, it is your value that will determine whether you'd get a job or not. And by value I mean what you can give.

1

I've been working in IT for about 34 years, I confess I might not be able to do this task. Here's why. I started life as an Intel assembly language programmer. Over the years, the last time I checked I've programmed in maybe 30 different languages. What I can tell you is that all programming languages are essentially the same, what is different is the syntax and the functions. I honestly don't program much in any particular language anymore. When I do it's to fix somebody else's code that doesn't quite work right (or the way I want it to). But, if you asked me to write you a program on a piece of blank paper in any particular language I couldn't do it. My problem is I don't program in any one language enough to remember the syntax, I always have to look it up. Can I do it with reference material, certainly, off the top of my head no way. Does this make me a bad programmer? Maybe. Can I write you a program in most any language if you allow me reference, certainly.

1

I am not a good programmer or I might be devaluating myself too.

what would be the optimal solution to the case scenario of the 1-100 multiples of 3 fizz, multiples of 5 fizzbuzz?

I'm thinking of something like (pseudocode)

for i=1;i<=100;i++

if i % 3 == 0 && i % 5 == 0 print FizzBuzz

else if i % 3 == 0 print Fizz

else print i

0