Tuesday, August 30, 2011

FizzBuzz in Eclipse

FizzBuzz took me four minutes, forty-five seconds to write correctly. The testing methods took considerably longer. I have not been coding in Java, lately, and I'm forgetting the basics.

Initially, I had written all the code into the main method. There were only trivial problems with it, which I resolved easily. The program worked well until I began to try to implement the test method, when Java began complaining that it was unable to resolve variable and method types. Because I did not spend time initially on the design, I paid for it after writing the program by stumbling through online Q&As, trying to reorganize the program. My experience here teaches two lessons. First, that if designing a well-structured program does not happen initially, it will probably cost time and cause lots of headaches later. Second, that the fundamental aspects of programming are vital. Without a solid foundation on which to build, none of the more advanced skills can be gained without constant stumbling over simpler tasks along the way. It also tells me I need to code every day, so I don't get out of practice. I am going to drill as much as I can, to get the fundamentals ingrained.

I tried a few different ways to resolve the error, and settled on making my methods static, which, if I remember correctly from the lecture, "smells." It works, though. This assignment shows that there are many ways to accomplish the same task, some better than others, which I think will be a central theme in this class.

Here is the code I wrote:

No comments:

Post a Comment