Skip to content

[Kwong Chung Yue Jerry] Duke Increments#354

Open
jerryk1997 wants to merge 60 commits intonus-cs2103-AY1920S1:masterfrom
jerryk1997:master
Open

[Kwong Chung Yue Jerry] Duke Increments#354
jerryk1997 wants to merge 60 commits intonus-cs2103-AY1920S1:masterfrom
jerryk1997:master

Conversation

@jerryk1997
Copy link
Copy Markdown

No description provided.

Comment thread src/main/java/Ui.java
*/
public void showFoundTasks(LinkedList<Task> taskList) {
ListIterator<Task> iter = taskList.listIterator();
Task current;
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Your code looks pretty clean with the accurate variable naming as well as javadocs comments. Perhaps you could consider making packages to make it more organized? Otherwise it looks good

@FXML
public void initialize() {
scrollPane.vvalueProperty().bind(dialogContainer.heightProperty());
dialogContainer.getChildren().addAll(DialogBox.getUserDialog(Ui.showWelcome(), dukeImage));
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 really like your idea of calling it in initialize, good job!

Comment thread src/main/java/Parser.java

ui.showTaskAdded(newEvent, taskList);
return ui.showTaskAdded(newEvent, taskList);
}
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Good use of OOP and clean code! But reading through this it might be slightly unclear, maybe you can refactor this part to use case and switch statements?

Copy link
Copy Markdown

@etlow etlow left a comment

Choose a reason for hiding this comment

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

Methods and variables are well named and I appreciate the use of StringBuilders! Just have some comments about some parts.

Comment thread src/main/java/Event.java
public Event(String description, String eventDate, boolean status) {
super(description);
this.eventDateString = makeEventDate(eventDate);
this.eventDate = storeAsDateTime(eventDateString);
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Can be replaced with this(description, eventDate);

Comment thread src/main/java/Parser.java Outdated
return builder.toString();
}

public static boolean correctInput(String input) {
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

How about isCorrectInput

Comment thread src/main/java/Parser.java
taskList.addTask(newEvent);

return ui.showTaskAdded(newEvent, taskList);
}
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Consider splitting into methods or classes. Maybe todo, deadline and event can go into another method parseTask, and the repeated lines can also be factored out?

Comment thread src/main/java/Task.java Outdated

sb.append(hour + ":" + minutes + ":00");

LocalDateTime dateTime = LocalDateTime.parse(sb.toString());
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

How about

DateTimeFormatter formatter = DateTimeFormatter.ofPattern("d/M/yyyy HHmm");
LocalDateTime dateTime = LocalDateTime.parse(date, formatter);

Comment thread src/main/java/Ui.java

return output;
}
} No newline at end of file
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Good splitting of code into methods!

Comment thread src/main/java/Parser.java
}
}

public boolean isExit() {
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

could you include javaDoc here

Comment thread src/main/java/Ui.java Outdated
return welcomeMessage;
}

public String showGoodbye() {
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Could you include javaDoc for this class

Comment thread src/main/java/Ui.java
}
}

public String showTaskDone(Task task) {
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

The two methods have the same body, maybe you could consider delete one.

Comment thread src/main/java/Task.java
* Filler method to imitate an interface.
* @return String empty string
*/
protected String toFileFormat() {
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

could you abstract this class and method?

Comment thread src/main/java/Duke.java
}
}

public String run(String input) {
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

You can probably add JavaDocs here

Copy link
Copy Markdown

@CarbonGrid CarbonGrid left a comment

Choose a reason for hiding this comment

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

Good morning @jerryk1997 ,

I think that you have good OOP implementation; class responsibilities are clear and non-conflicting, e.g Ui not managing anything else other than I/O interaction. However, I believe you haven't used gradle checkstyle to verify your compliance to coding standard. In addition, I think you could try extracting repeated methods calls to reduce code duplication. You could also improve the parser by simplifying multiple if-case into a switch-case. This should also simplify input verification as non-expected inputs will generally enter into the default case.
There is also a Ui issue.
image

But all in all. It is good individual effort with taught methodologies.
Keep it up. 👍

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants