Skip to content

[Jeremykhoo] iP#360

Open
MrJeremyKhoo wants to merge 46 commits into
nus-cs2103-AY2223S2:masterfrom
MrJeremyKhoo:master
Open

[Jeremykhoo] iP#360
MrJeremyKhoo wants to merge 46 commits into
nus-cs2103-AY2223S2:masterfrom
MrJeremyKhoo:master

Conversation

@MrJeremyKhoo
Copy link
Copy Markdown

@MrJeremyKhoo MrJeremyKhoo commented Jan 30, 2023

DukeExtended

duke now can:
remember to do things - duke

  • store tasks
  • remember deadline
  • help you be productive
    all you need is :
  1. time
    2. patients to learn
    there are even task lists:
  • like this
  • and this :shipit:

main is

public class Main {
    public static void main(String[] args) {
        Application.launch(MainApp.class, args);
    }
}

Copy link
Copy Markdown

@Junyi00 Junyi00 left a comment

Choose a reason for hiding this comment

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

Great Effort!

Comment thread src/main/java/Deadline.java Outdated
Comment on lines +3 to +11
protected String by;
public Deadline(String description, String by) {
super(description);
this.by = by;
}

@Override
public String toString() {
return "[D]" + super.toString() + " (by: " + by + ")";
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 believe this file has extra level of indentations here weirdly. I notice the same issue occurring in other files too...

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

private static void addList(Task task) {
list.add(task);
System.out.println("added: " + task.getDescription());
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 it better if we just use the task's string representation here instead? This would consequently remove the need for an extra getter in the Task's class

Comment thread src/main/java/Duke.java Outdated
private static void deleteTask(int i) {
int index = i - 1;
System.out.println("removed: " + list.get(index).toString());
System.out.print("You have: " + (list.size() - 1)+ " task(s)");
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Missing trailing whitespace before '+'. This is a common issue found in other part of the codebase too.

Comment thread src/main/java/Duke.java Outdated
Comment on lines +81 to +87
catch (IllegalArgumentException e) {
throw new DukeException(e);
}

catch (Exception e) {
throw new DukeException(e);
}
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 shifting your try-catch logic wrapped around the switch-case block instead? That would reduce some code duplication when the same exception could be thrown

Comment thread src/main/java/Duke.java Outdated
parseIn(parm);
}
catch (DukeException e) {

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 see that the DukeException will send a message to user when it is created, I believe adding a comment for this behaviour would be helpful for others to understand why there is an empty catch block.

Comment thread src/main/java/Duke.java Outdated
int byIndex;
int fromIndex;
String description;
List<String> l;
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

List<String> l could be given a more descriptive variable name, similar for variable names like f and t

Comment thread src/main/java/Duke.java Outdated
import java.util.Arrays;
public class Duke {
public static void main(String[] args) {
private static ArrayList<Task> list;
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

This is an interesting concept of ensuring only one instance of task list exists. Any reason it is designed this way? If new Duke was somehow initialised, the array list is 'resetted' base on how the constructor is written now

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

public String getStatusIcon() {
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

This could be set to private since it is only used internally within the class

Copy link
Copy Markdown

@kohkaixun kohkaixun left a comment

Choose a reason for hiding this comment

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

There are probably a few nits to take care of before merging. But those nits are mostly coding standards stuff like more specific names, indentation and spacing.

Comment thread src/main/java/Deadline.java Outdated
@@ -0,0 +1,13 @@
public class Deadline extends Task {

protected String by;
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

There seems to be extra indentation for every line in not just this file, but the other files as well.

Comment thread src/main/java/Duke.java Outdated
}
break;
case "event":
try{
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 leave a space between the try and starting curly bracket?

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