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

[Toh Hai Jie Joey] iP #343

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

Conversation

JoeyToh
Copy link

@JoeyToh JoeyToh commented Aug 25, 2020

No description provided.

@JoeyToh JoeyToh changed the title Toh Hai Jie Joey [Toh Hai Jie Joey] iP Aug 25, 2020
Copy link

@kunnan97 kunnan97 left a comment

Choose a reason for hiding this comment

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

Overall, your code is good and easy to read. Just some nits to correct, having shorter methods and method names that contain verbs can improve the code even better!

}

/**
* An overridden method that returns a String with the Task type,

Choose a reason for hiding this comment

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

Maybe there is no need to state that it is an overridden method.

* Helps separate out key details in the input such as the task details and date.
* @throws DukeException When user input is wrong or incomplete.
*/
public void parse() throws DukeException {

Choose a reason for hiding this comment

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

Be wary when a method is longer than the computer screen, and take corrective action when it goes beyond 30 LOC (lines of code). The bigger the haystack, the harder it is to find a needle. - https://nus-cs2103-ay2021s1.github.io/website/se-book-adapted/chapters/codeQuality.html

* @param task Event details.
* @param date Date of event.
*/
public void event(String task, String date) {

Choose a reason for hiding this comment

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

Method names should contain verbs, seems like some other methods have this issue too

Comment on lines 5 to 9
public static String logo = " ____ _ \n"
+ "| _ \\ _ _| | _____ \n"
+ "| | | | | | | |/ / _ \\\n"
+ "| |_| | |_| | < __/\n"
+ "|____/ \\__,_|_|\\_\\___|\n";
Copy link

Choose a reason for hiding this comment

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

The logo can variable can be set as a private static field.

Comment on lines 18 to 19
private static final String DESTINATION = "./duke.txt";
private final Path path;
private static String DESTINATION = "./duke.txt";
Copy link

Choose a reason for hiding this comment

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

Nice work. Constant names must be all uppercase using underscore to separate words.

Comment on lines 74 to 83

storage.addData(list.getList());
System.out.println(LINE);
storage.addData(list.getList());

} catch (DukeException e) {
System.out.println(e.getMessage());
System.out.println(LINE);
}
} catch (DukeException e) {
toReturn += e.getMessage();
toReturn += "\n";
}

sc.close();
end();
toReturn += LINE;
return toReturn;
Copy link

Choose a reason for hiding this comment

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

This method is too long. Might make it very difficult to debug 🤔

@@ -9,6 +9,9 @@
private List<Task> list;
Copy link

Choose a reason for hiding this comment

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

Plural form should be used on names representing a collection of objects.

@@ -182,28 +180,31 @@ public void event(String task, String date) {
* @param task Deadline details.
* @param date Date of deadline.
*/
public void deadline(String task, String date) {
public String deadline(String task, String date) {
Copy link

Choose a reason for hiding this comment

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

Method names should be verbs

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.

None yet

3 participants