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

[Jeremykhoo] iP #360

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

Conversation

MrJeremyKhoo
Copy link

@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

@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 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

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...


private static void addList(Task task) {
list.add(task);
System.out.println("added: " + task.getDescription());
Copy link

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

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

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 on lines 81 to 87
catch (IllegalArgumentException e) {
throw new DukeException(e);
}

catch (Exception e) {
throw new DukeException(e);
}
Copy link

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

parseIn(parm);
}
catch (DukeException e) {

Copy link

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.

int byIndex;
int fromIndex;
String description;
List<String> l;
Copy link

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

public class Duke {
public static void main(String[] args) {
private static ArrayList<Task> list;
Copy link

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

this.isDone = false;
}

public String getStatusIcon() {
Copy link

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

@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.

@@ -0,0 +1,13 @@
public class Deadline extends Task {

protected String by;

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.

}
break;
case "event":
try{

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