Last week, groups were formed to write code for the IBM plugin game CodeRuler. Now that the fun is over, the task this week is to analyze the code formatting and see if it follows the coding standards of Elements of Java Style and our ICS supplemental standards. I was assigned to review Raqueno-Reeves's CodeRuler project. Their source code can be found at the following link: Raqueno-Reeves CodeRuler.
JavaDocs:
The JavaDocs are well written. The intro or description to the class was detailed and useful. It covered everything from purpose of class, strategy, and citation. Each method began with a good concise sentence that summarizes the function of the method.
My only complaint is when describing some of the parameters, perhaps there could be a more detailed description. Some parameter description seem redundant (e.g. xPos - x position). Perhaps a more useful description would be "the current x-coordinate of peasant/knight/etc". I just noticed some of the javadocs did not provide a description on the return value of certain methods. Considering the amount of detail in other areas, I think it was just a minor error that was probably overlooked.
Structure & Logic:
Everything looked good. At first, I was sort of wondering on the method movePeasants. It is quite short which made me wonder if it deserved its own method. But looking at it again, there is a lot going on in the setDir that is worth documenting as a separate entity. Creating the method movePeasants also keeps commands looking parallel in orderSubjects. It would have been weird to have seen....
makeUnits();
for(...){
move...
}
moveKnights();
Formatting:
File | Lines | Violation | Comments |
MyRuler.java | 52,187,214,* | ICS-SE-Eclipse-2 | Code exceeds 100 characters |
MyRuler.java | 94,231,236,* | EJS-9 | Variable names represented by single char |
I like the detail. I personally don't know how many one-line comments is too much. But I like the amount of information given. I thought the comments were helpful and the formatting is readable. Although I didn't look too much in detail, I think the code can be manageable.
Conclusion:
Well first on their strategy. Dang! This thing captures land pretty fast! Its initial knights don't normally last very long. But the amount of land claimed makes production of backup knights overwhelm the opponent. Back to the formatting, I am still fairly new to the standards introduced this semester. I may be misjudging at certain things. Considering it's only been a week since these concepts have been introduced, I thought Robin and Ron did a really good job formatting their code.
No comments:
Post a Comment