Swimming along the stream of Robocode programming, our software engineering class ran into the pole in the water known as standards. After tackling the problem last time of making several different robots that perform different tasks we were asked to take our coding to a more professional level and adhere to a set of reasonable standards.
Curious minds can find the standards for the class in general here, and the standards for our classes Robocode itself here. We also use the book the The Elements of Java Styles, found on Amazon here (no online source available that I know of).
Regardless of what rules we are looking at, standards are both the blessing and a curse for me personally. Standards are important for keeping everyone on the same page of understanding, making taking anything and understanding, studying, improving, and using it that much easier. But for me personally when standards are many and precise they cause issues with my own personal style. I’m not saying I don’t like standards, but I found in my experiences with our assignment to reach standards for our code that my own style tends to be constantly changing. Lines which were commented in one way were commented slightly different in a different program. I suppose if you were to give an analogy to computer themselves my RAM isn’t storing how I did it before and I don’t have it stored on my hard drive.
With a bit of effort and constant cross referencing I was eventually able to bring my code into a similar style to each other if not very close to the standards given for the class. It is a bit of relief to open each of the robot's files now and see them looking similar in style and information. Prior to this class I had only used comments and long comment and not had any exposure to proper form or JavaDoc level commenting, so getting the hang of that was quite new and refreshing. Still the struggle with trying to keep ideas consistent in every installment of similar code will be a challenge for me in the future. While it is true that repetition is the key to learning something well, it’s become apparent to me that it is also the key to standardization, as slowly doing things the same way leads to a standard that you can feel comfortable in.
For the coding most of it was applying JavaDoc style comments to define the class and methods used as well as sticking comments in appropriate areas with good reasons for what the code does at that portion not just what it does. One of the things they say that echoes in my mind is that the code should be understandable with comments even if the code without comments is not and that the person reading it without understanding the code may even be you. Trying to keep the descriptions of the code clear enough so that I can understand it if I were away from it for a long time is something I keep in mind at all times.
I mentioned it last time that I conference with peers about some of the more difficult mathematical concepts to visualize and having them was invaluable to keeping the code efficient and to our standards. Edward Meyer’s reminded me that I could use Arc tangent to find the angle instead of Arc Cosine and it was using trigonometry that first occurred when I was working with Kimberly Heu in class. Thanks to both of them the robots were able to travel smoothly at any given angle. Having peers to confer with leads to seeing other perspectives and finding new and possibly better ways to accomplish something, it’s definitely something I feel is necessary in most points of life.
As coders we aren’t salmon swimming up the streams of projects, we don’t have that kind of muscles to do so without support. It is from these poles which we call standards and the support lines we call peers that coders can get through the struggles of programming in code and reach a destination clearly without getting lost or tangled up in their own lines of code. And with our support pole in place we are ready to push off it towards new challenges in the Robocode River, because soon it will be time for the class to challenge each other in the field of Robocode.
My implementation with attempts to adhere to the class standards is found here(Note: Internet Explorer users will mysteriously find that clicking it results in a .zip, the original file is a .jar file, Firefox does not seem to have this problem.)
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment