For this assignment my tasks were to review Jung's implementation of the CodeRuler class and find any formatting errors that do not follow the Java coding and documentation standards. After reading "The Elements of Java Style", I learned that there is more than just inserting comments, choosing proper variable names and method names to make our code more readable.
At first sight it seemed to me like Jung did a good job in formating his code and making it readable to a reviewer. However, I found some minor and some major issues that do not follow Java Style which is alright since our class did not have the chance to read "The Elements of Java Style" before implementing the CodeRuler class. Moreover, some of the loops should include block statements to make the code more readable and easier to modify if necessary.
In conclusion, it was very interesting to see someone else's style of writing Java code and to find out potential Java coding and documentation standard errors. Finding such errors in code that was not written by me, helped me to stayed focused through out the whole review while learning the correct way of documenting Java code.
Just a suggestion, try to figure out how to use your knights to attack either the enemy peasants or the enemy knights and I am sure that you will have a greater chance of winning.
Below is a Table summarizing all the Java coding and documentation standard errors that I found in Jung's implementation of the CodeRuler class.
FILE | LINES | VIOLATION | COMMENTS |
MyRuler.java | 94, 104 | EJS 6 | Break up long lines |
MyRuler.java | 32, 33, 34, * | EJS 8 | Do not use hard tabs |
MyRuler.java | 41, 48, 63, * | EJS 37 | use one-line comments to explain implementation details |
MyRuler.java | 23 | not sure | put closing '}' at newline |
MyRuler.java | 8, 9 | EJS 46 | Establish and use a fixed ordering for Javadoc tags (@version missing) |
MyRuler.java | 116 | EJS 49 | Omit the subject in summary descriptions of actions or services |
MyRuler.java | 63 | EJS 59 | Add internal comments only if they will aid others in understanding your code. |
MyRuler.java | 63 | EJS 60 | Describe why the code is doing what it does, not what the code is doing |
MyRuler.java | 33 | EJS 62 | Explain local variable declarations with an end line comment |
MyRuler.java | 108, 109, 112, * | EJS 64 | Lable closing braces in highly nested control structures |
MyRuler.java | 110, 125, 134, * | EJS 76 | Use block statements instead of expression statements in control flow constucts |