Sunday, September 14, 2008

Review of another CodeRuler implementation

In an effort to further familiarize myself with the coding practices that I will be using throughout my Software Engineering course (and beyond!), I have been tasked with reviewing one of the other CodeRuler projects submitted to the class. I will be reviewing the MyRuler.java class of Tyler Wolff and Daniel Tian. I downloaded the zip file containing the class and its Javadocs from this link on September 10, but had some difficulties with the zip file and was unable to properly unzip the Javadocs due to a corrupted file. I wasn't able to determine the cause of this error, but was able to extract the MyRuler.java file without troubles.

During our Wednesday class period I was very excited to see this implementation in action as Tyler and Daniel's blogs showed it to be very successful in their tests. Unfortunately it seemed to have encountered a problem during the demonstration and failed to successfully perform any moves. However testing on my own computer was fine and it was perfectly capable of performing up to the standards claimed. In fact it is the only of the implementations I saw that could compete and quite possibly surpass the implementation of Arthur Shum and myself.

Despite not being able to convince my computer to open the javadocs, they were luckily available right in the code and appeared to be thorough. The structure and methods used in the class made sense. Each method was dedicated to a specific task and each well explained. The orderSubjects method is simple and is able to delegate the complex tasks of the implementation to other methods but outlines the workings of the class. The inline comments within various methods help with understanding the logic of the program quickly, though some were redundant. Since many of the variables names consist of three or four words, the code for certain tasks get a bit unwieldy and a number of lines cross well over 100 characters in length. However the logic is quite solid and it's performance outside of the class demonstration is superb.

For the most part the formatting and style of the code is quite close to what is put forth primarily by The Elements of Java Style by Allan Vermeulen, et al. The following chart demonstrates the lapses in proper coding style I observed.

File Lines ViolationComments
MyRuler.java1Use of * in import.
MyRuler.java16-28Possibly excessive HTML code in javadoc comments.
MyRuler.java7, 60, 183, *EJS-49Omit subject in describing methods.
MyRuler.java54Explain empty method.
MyRuler.java82, 123, 130, *EJS-7Closing bracket not on its own line.
MyRuler.java87Possibly confusing end-line comment. End of if? or end of else?
MyRuler.java79, 84, 90EJS-7No space between for and (.
MyRuler.java109No period ending description.
MyRuler.java120, 121, 127, *Four space indent instead of two.
MyRuler.java120, 127, 134, *EJS-61Unnecessary end-line comments.
MyRuler.java210May want to use parentheses to seperate logic operations.
MyRuler.java211, 212, 215, *Way over 100 characters in these lines.
MyRuler.java239, 365, 427, *EJS-7Beginning bracket for else statement should be on same line as else.


The errors found do not have a huge impact on the readability and reliability of the program. Most can be quickly repaired now that all of the members of the class are more aware of the strict style we should to be adhering to. There is ample commenting of the code, and perhaps too much in several areas where they do not really offer any additional information. Overall though it is an impressive strategy and implemented relatively cleanly and efficiently.

No comments: