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

[Chiam Jia-En] IP #106

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

Conversation

Chiamjiaen
Copy link

Add Greet, Echo, Exit.
Add task, list, mark done, todo, event and deadline.

Copy link

@rafaelperes rafaelperes left a comment

Choose a reason for hiding this comment

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

Good Job! ;)


@Override
public String toString() {
return "[D]" + super.getDescription() + " (by: " + by + ")";

Choose a reason for hiding this comment

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

maybe you should make the use of constants in order to avoid magic strings here...


@Override
public String toString() {
return "[E]" + super.getDescription() + " (at: " + at + ")";

Choose a reason for hiding this comment

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

same goes here...refer to line 11 Deadline.java comments

String currentRead = saveFileScanner.nextLine();
String[] taskSave = currentRead.trim().split(" \\| ");
switch (taskSave[0].trim()) {
case "todo":
Copy link

@rafaelperes rafaelperes Feb 21, 2021

Choose a reason for hiding this comment

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

maybe change "todo", "deadline","event" to constants (enum?) in order to remove magic strings. In addition, maybe you should make the use of Single Level of Abstraction Principle (SLAP) concept and for each case statement devise a method to handle the abstractions.

case "list":
list.printList();
break;
case "done":

Choose a reason for hiding this comment

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

same goes here... maybe you should improve your code abstraction by having a single method (in charge for the abstraction) for each case statement

}

public String getStatusIcon() {
return (isDone ? "\u2713" : "\u2718"); //return tick or X symbols

Choose a reason for hiding this comment

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

refer to the magic string comment.

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.

2 participants