[Sean Ng] iP#286
Conversation
aweijun
left a comment
There was a problem hiding this comment.
Looks good, learned a lot from reviewing your IP!
Some cosmetic changes that were proposed.
| * @return The completed task. | ||
| */ | ||
| public Task mark(int index) { | ||
| Task task = this.tasks.get(index); |
There was a problem hiding this comment.
I am unsure if "this" statement is necessary?
This doesn't recommend based on the coding standard.
Can considering removing this statement.
There was a problem hiding this comment.
I wasn't aware of this, my perception was that the "this" keyword should be used where possible to make the code more explicit. I tried finding information related to the "this" keyword in the coding standard document @ https://se-education.org/guides/conventions/java/intermediate.html but couldn't find it, mind pointing me in the right direction? thanks 😄
clement0010
left a comment
There was a problem hiding this comment.
Overall, the code follows coding standards and not many issues to nitpick. Good Job!
| return isDone ? "X" : " "; | ||
| } | ||
|
|
||
| public boolean descriptionContains(String keyword) { |
There was a problem hiding this comment.
Perhaps containsDescription or hasDescription would sound better for this function?
| } catch (IndexOutOfBoundsException e) { | ||
| throw new DukeException("Invalid parameter(s). duke.task.Task " + (index + 1) + " does not exist"); |
There was a problem hiding this comment.
I think IndexOutOfBoundsException will never be caught here? The error will be thrown in the execute function and the same error was handled there as well.
| */ | ||
| public TaskList load() { | ||
| Path dataFolder = Path.of(PROJECT_ROOT, "data"); | ||
| if (!Files.exists(dataFolder)) { //initialize data directory if not present |
Add assertions in Duke constructor to ensure fields are properly initialized.
Split up ShowFindTasks and ShowTasks to improve code quality
Users have no way to list all commands. Let's insert a help command so that users can see all commands and their syntax and purpose.
Duke bro
👍 Emojis are cool
This is a hyperlink
This is
inline code.bold italic
strikethrough