Monday, August 31, 2009

Falling Off the Java Bicycle: FizzBuzz Implementation

After a two year break from java, I once again returned on the popular java programing language, and this time I feel off the bike pretty hard. The object of the program is insanely simple after programing for a few years. I understood exactly what I had to do and what I needed to do to get there the second the program was described. Then why did I fall? The primary reason was the my decaying memory of the java language syntax. Writing java down on a pice of paper after two years was insanely hard. With only fragments of the opening syntax, many a times I would look down and realize my line prints in C. Quite embarrassing to come into a high level class like this I feel like a total beginner again.

After the failure in class, the assignment was the do the code once more. This time I remembered the correct syntax and was allowed to use the Eclipse editor, needless to say, I was able to blaze through with all the speed of a top notch muscle car. From the time the editor loaded to the completion of the comments and test run, it took all but two or three minutes. Half the speed comes from the Eclipse editor as it has many useful features such as autofilling of functions and easy copy paste features. Eclipse also allows you to shave from a few seconds off your time to a few minutes depending on the program with its pre-filled public static method, and the amazing ability to compile and give error messages while you code. Overall even with such a simple program, even programmer can fall into these simple traps, and the course design gives an overall feeling of a well designed prep course.

Below is my second attempt at the FizzBuzz program:

No comments:

Post a Comment