Skip to content
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

[Goh Wei Kiat] iP #270

Open
wants to merge 65 commits into
base: master
Choose a base branch
from
Open

Conversation

mrweikiat
Copy link

Reopening my current PR based on feedbacks from Prof

Copy link

@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! ☺️

ui.showHelpMessage();

// Condition for Duke to stop
boolean terminate = false;

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

}
} 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;

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

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");

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


static String logo =

" ,--. ,--. ,--. \n" +

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")) + " " +

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

@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!


case "DONE":

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

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)

ui.showHelpMessage();

// Condition for Duke to stop
boolean terminate = false;

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!

}
} 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;

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

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?


}


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