Saturday, September 1, 2007

Code Ruler Review

I am assigned to review Marcius and Ka Yee’s code. Their code does not have many violations of the Java standard, and I am a little surprised that they are actually using the two spaces indentation. Here is a table of the violation of their code:
FileLinesViolationComments
MyRuler.java92,152,158, *EJS-76The “if” should always has curly brace
MyRuler.java106,136EJS-5The “else if” should be on the next line
MyRuler.java124EJS-61Avoid the use of end-line comment
MyRuler.java9,149EJS-6Comment longer than 100 characters
MyRuler.java79,97,129ICS-SE-JAVA-9Prefer using for/in structure

I like the idea how they split up the knights into two groups, which is similar to the built-in split up ruler. Also from the result of their testing, it seems this strategy has worked quite nicely against the built-in ruler. Overall this is a nicely written code.

No comments: