Wednesday, August 31, 2011

An Analysis of the FizzBuzz Implementation

FizzBuzz should be a pretty simple implementation for computer science graduates right? A program that outputs number 1 thorugh 100, printing only "Fizz" when the number is multiple of 3, "Buzz" when it is multiple of 5, and "FizzBuzz" when the number is multiple of 15. Simple enough, but I was told by a professor during a class that most employee when they are recruiting, they ask the applicants to implement the FizzBuzz program. Should not be that hard right? Surprinsingly, my professor furiously told us that most of the applicant failed to implement the program. I was surprised. Then he assigned us to write the program.

Below here is the FizzBuzz program I wrote in Java.


I time myself and it took me around 8 minutes to write it. I was being a newbie, because I tried to put the for loop inside the method which will might not return any value if all of the statements were false. That was my mistake and it took me a couple of minutes to figure it out. Other than that, I am pretty much comfortable with eclipse cause I have used it since my very first Java programming class
I guess if a programmer knows how to program, but have not touch or used a program for a long time, then he/she might run into some problems as me when coding again. Learning new languages program takes time and some motivation. Also, it requires for the programmer to be able to keep up with program as new updates and features are developed so fast that it is easy to fall behind.

No comments:

Post a Comment