In all the java coding that I have read so far in my short career, I have seen some very complex java code that was very hard to understand. This was due to the fact that the code wasn't well documented, which made it very hard to follow. This made me waste a lot of time just trying to figure out exactly what certain methods and classes did within the program. This has taught me that proper documentation saves the person reading code a lot of time.
Not only will following proper coding standards reduce the reading and understanding time of another person's code, but it will also increase it's reuse ability because of it. Many times, java programmers finish a project and move onto other things, then other programmers may want to improve on the code. In these cases, having the proper java coding standards are most important. Since it saves the programmers that take over and improve the code a lot of time understanding exactly how the code works.
To help myself have better coding standards, I have read a book called The Elements of Java Style. I also follow the java coding standards of my software engineering class found here. After reading those coding standards, I started fixing my code from my previous robocode assignment. I, like many programmers, did not follow all of the coding standards. I had to fix a lot of my documentation because I didn't explain why a method was there but rather what the method does. This my biggest problem because I realized that I have always been breaking coding standard.
While fixing my code to conform to the java coding standards, I also had a chance to fix up some of my codes that were not able to work properly by looking at how some other people in my class did it. I ended up adopting code from Kimberly Heu for my Tracking03 robot. Her code was very easy to understand since she docuemented it well, and her robot worked perfect also.
My new updated code can be found here.
Sunday, September 13, 2009
Subscribe to:
Post Comments (Atom)
0 comments:
Post a Comment