Week 11: CST 338 Module 3
This is the eleventh week of the CSUMB computer science program (P.S this was delayed a little).
Summary From My Peers:
The two teammates that reviewed my code were Noah and Nasser. Therefore, the overall summary of what they provided was that my code being overall good; although, there could have been a more efficient way of creating the attackModifier method, as they suggested optimization and the use of a single if-statement instead of checking each type separately, while there were some warnings that could have been avoided if I used a more enhanced for-loop instead of regular loops. Otherwise, they agreed that I have clear variable names, formatting of code, proper comments, and that all my tests passed.
Reviewed Code:
Review for Nasser:
- Variable names:
- The variables have clear and descriptive names.
- Logic Efficiency:
- The attackModifier method would have been more efficient as there is some repetition when checking for elemental types, which could have taken a map (HashMap) to create a more efficient logic.
- The calculateAttackPoints method could be optimized, as the for-each loop could use caching techniques or limiting recalculations.
- Unused Imports or warnings:
- There aren't any unused imports within the code.
- There are a few warnings, but they are mostly within the JavaDoc comments due to them not fully being implemented, as a @return needs a description and the @param needs the parameter and a description.
- Formatting:
- The code is properly formatted and is clear, which makes it easy to go through the code.
- Comments:
- The methods that required JavaDoc comments have them, while there are also comments on other methods; although, they are not JavaDoc comments as well.
- Unit Tests:
- All the unit tests passed.
Review for Suhaib:
- Variable names:
- The variable names are meaningful and are clear in what they represent.
- Logic Efficiency:
- The setType() method could be optimized, as the attackModifier within it could have been implemented through a HashMap instead of if-else statements to make the logic more concise.
- Unused Imports or warnings:
- There aren't any unused imports within the code.
- There are a few warnings, but they are either parameters or other logic that was a part of the assignment.
- Formatting:
- The formatting was clear and easy to read, thus making it proper without issue.
- Comments:
- The methods that required JavaDoc comments have them, while there are also comments on other methods.
- Unit Tests:
- All the unit tests passed.
- I noticed that both Nasser and Suhaib implemented complex methods, which can lead to some difficulties in maintaining clarity and efficiency, given that the game itself didn't require overly complicated logic. Some of the methods, such as attackModifier() and calculateAttackPoints() have logic that could be simplified or optimized, as there are other ways in managing multiple conditions without having to rely on if-statements.
- I noticed that both Nasser and Suhaib have comments with different details, structures and documentation. Some of the methods are well described, while others lack in-depth explanations on the logic behind them.
- The code I struggled the most on was the attackModifier, as I initially used a for-loop; however, it didn't implement the modifier correctly, which led to incorrect outputs, thus I was required to spend an hour or two simply implementing the logic through if-statements to correctly apply the modifier. Nevertheless, for the rest of my code, it was somewhat straightforward; although, I took a bit to fully implement all the methods.
- Setting up the getters, setters, constructors, and classes was the easiest aspect of the code, as Intellij IDEA provided ways to implement the logic easily and efficiently.
- Getting all the tests passed, while making the codes outputs as similar to the required outputs in the prompt. In the end, getting the code working and properly emulating the expectations is my biggest victory.
Comments
Post a Comment