Skip to content

[Goh Wei Kiat] iP#270

Open
mrweikiat wants to merge 65 commits into
nus-cs2103-AY2021S2:masterfrom
mrweikiat:master
Open

[Goh Wei Kiat] iP#270
mrweikiat wants to merge 65 commits into
nus-cs2103-AY2021S2:masterfrom
mrweikiat:master

Conversation

@mrweikiat
Copy link
Copy Markdown

Reopening my current PR based on feedbacks from Prof

Copy link
Copy Markdown

@danielonges danielonges left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall, it was a pleasant experience reading your code! No major coding standard violations were found, just some minor tweaks that might need to be done here and there. Otherwise, LGTM! ☺️

Comment thread src/main/justin/Justin.java Outdated
ui.showHelpMessage();

// Condition for Duke to stop
boolean terminate = false;
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this be canTerminate? Might be better to change to reflect boolean variable name

Comment thread src/main/justin/Storage.java Outdated
}
} else if (task.getList().get(i) instanceof Deadline) { // is a deadline class
if (task.getList().get(i).isDone) {
holder = "D" + "|" + "1" + "|" + task.getList().get(i).description + "|" + ((Deadline) task.getList().get(i)).by;
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Might have exceeded line limit

Comment thread src/main/justin/Ui.java Outdated
printSpace();
System.out.println("To add a todo: use command todo<space>taskName");
System.out.println("To add a deadline: use command deadline<space>taskName<space>/by<space>YYYY-MM-DD");
System.out.println("To add a event: use command event<space>taskName<space>/at<space>YYYY-MM-DD<space>HH:MM");
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Might have exceeded line limit

Comment thread src/main/justin/Ui.java Outdated

static String logo =

" ,--. ,--. ,--. \n" +
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Might want to consider shifting "+" operator to begin on new line


@Override
public String toString() {
return "[E]" + super.toString() + " (at: " + date1.format(DateTimeFormatter.ofPattern("MMM d yyyy")) + " " +
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Might have exceeded line limit

Update JUnit testing
Copy link
Copy Markdown

@weixue123 weixue123 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi Wei Kiat, I feel that your code is quite well segmented. Great work!

Comment thread src/main/java/justin/Justin.java Outdated

case "DONE":

String num = text.substring(5); // take out the int value of the task to be completed
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it be clearer if a named constant or method was used to extract the task number instead? (instead of using a "magic" number)

Comment thread src/main/java/justin/Justin.java Outdated
ui.showHelpMessage();

// Condition for Duke to stop
boolean terminate = false;
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I feel that the code is clear enough for certain comments to be omitted!

Comment thread src/main/java/justin/Storage.java Outdated
}
} else if (task.getList().get(i) instanceof Deadline) { // is a deadline class
if (task.getList().get(i).isDone) {
holder = "D" + "|" + "1" + "|" + task.getList().get(i).description + "|" + ((Deadline) task.getList().get(i)).by;
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps use a method to reduce the code duplication here?

if (text.length() < 5 && text.contains("todo") ) { // case 1
throw new JustinException("☹ OOPS!!! The description of a todo cannot be empty.");
}
else if (text.contains("blah")) { // case 2
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

According to convention and for better readability, maybe consider indenting the trailing comments to the same tab setting?


}


Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think there are times when it is not really necessary to have multiple blank lines in between parts of your code?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants