-
Notifications
You must be signed in to change notification settings - Fork 270
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Sean Ng] iP #286
base: master
Are you sure you want to change the base?
[Sean Ng] iP #286
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 😄
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great work for the IP!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps containsDescription
or hasDescription
would sound better for this function?
src/main/java/duke/Parser.java
Outdated
} catch (IndexOutOfBoundsException e) { | ||
throw new DukeException("Invalid parameter(s). duke.task.Task " + (index + 1) + " does not exist"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good use of guard clause here
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