Skip to content

[Cheng-Zhiyuan] iP#176

Open
Cheng-Zhiyuan wants to merge 69 commits into
nus-cs2113-AY2425S2:masterfrom
Cheng-Zhiyuan:master
Open

[Cheng-Zhiyuan] iP#176
Cheng-Zhiyuan wants to merge 69 commits into
nus-cs2113-AY2425S2:masterfrom
Cheng-Zhiyuan:master

Conversation

@Cheng-Zhiyuan

Copy link
Copy Markdown

Added Level-0, Level-1, Level-2 and Level-3 commits with respective tags.

@venicephua venicephua left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Overall very clear and easy to read!

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

protected String dateRange;

public Event(String description, String dateRange, String to) {

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 remove unused parameter "to"?

Comment thread src/main/java/Thoth.java Outdated
while (true) {
userInput = ui.readInput();
// exit condition
if (userInput.equals("bye")) {

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 can consider using switch-case instead of if-else since there are quite a few if-else statements?

Comment thread src/main/java/Thoth.java Outdated
TaskManager taskManager = new TaskManager();
UserInterface ui = new UserInterface();

// Print Greeting.

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 can remove these comments as it is rather intuitive from the variable names/functions?

Comment thread src/main/java/UserInterface.java Outdated
}

public static void printMarkAsDone(Task task) {
System.out.printf(INDENT + "Nice! I've marked this task as done:%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.

perhaps can define these messages as constants to make the code cleaner?

@JinbaoAlex JinbaoAlex left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Keep up the good work!

Comment thread src/main/java/TaskManager.java Outdated
@@ -0,0 +1,27 @@
// For Task commands
public class TaskManager {
public static final int MAX_TASKS = 100;

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 work naming constants in all caps

Comment thread src/main/java/Task.java
public static final String MARKED_BOX = "[X]";

protected String description;
protected boolean isDone;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

correct naming of booleans

Comment thread src/main/java/Task.java
this.isDone = false;
}

public void markAsDone() {

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 job in using camel case for methods

Comment thread src/main/java/Todo.java Outdated
super(description);
}

@Override

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 practice to specify overrides

Comment thread src/main/java/UserInterface.java Outdated
@@ -0,0 +1,51 @@
import java.util.Scanner;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

like the proper way to do imports

@thomasjlalba thomasjlalba left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Great work so far on your iP! Just minor nitpicks on the code quality and standards that I have suggested

Comment thread src/main/java/thoth/main/Thoth.java Outdated

public class Thoth {

public static void main(String[] args) {

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 quite like how you have done quite a bit of abstraction to simpler methods throughout your repo!

Comment thread src/main/java/thoth/parser/Parser.java Outdated
int taskIndex = Integer.parseInt(userInput.replace("mark", "").trim()) - 1;
return new MarkCommand(taskIndex);
} catch (NumberFormatException e) {
return new UnknownCommand("Please enter a valid number for mark command.");

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Maybe you can try to avoid magic literals

Comment thread src/main/java/thoth/parser/Parser.java Outdated
if (timeParts.length > 1) {
to = timeParts[1].trim(); // Extracts "4pm"
}
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Maybe you can add a final else statement to catch any unwanted errors

public static Command parse(String userInput) {
userInput = userInput.trim();

if (userInput.equals("bye")) {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Small nitpick but maybe you can standardise the spacing between the if/else statements if(statement){ vs if (statement) {

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Noted I will make changes. Thank you~

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.

4 participants