Skip to content

[Chen Shun] IP - #491

Open
csheun wants to merge 43 commits into
nus-cs2103-AY2223S1:masterfrom
csheun:master
Open

[Chen Shun] IP#491
csheun wants to merge 43 commits into
nus-cs2103-AY2223S1:masterfrom
csheun:master

Conversation

@csheun

@csheun csheun commented Aug 27, 2022

Copy link
Copy Markdown

DukePro

“Your mind is for having ideas, not holding them.” – David Allen (source)

DukePro frees your mind of having to remember things you need to do. It's,

  • text-based
  • easy to learn
  • FAST SUPER FAST to use

All you need to do is,

  1. download it from here.
  2. double-click it.
  3. add your tasks.
  4. let it manage your tasks for you 😉

And it is FREE!

Features:

  • Managing tasks
  • Managing deadlines (coming soon)
  • Reminders (coming soon)

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

LGTM. Just minor things to fix.

Comment thread src/main/java/Pony.java Outdated
private String line = "___________________________________________________";
private String exit = "Bye. Hope to see you again soon!";
Scanner sc = new Scanner(System.in);
ArrayList<Task> tasks;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Should tasks be private instead of public ?

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

}

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 like where you have multiple exceptions to account for different errors.

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

private String getStatusIcon() {
return (isDone ? "[X]" : "[ ]"); // mark done task with X

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 you can move the comment to the top.

Comment thread src/main/java/Task.java Outdated
return this.getStatusIcon() + " " + this.description;
}

//...

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Should this be removed?

Comment thread src/main/java/ToDo.java Outdated
@@ -0,0 +1,12 @@
public class ToDo extends 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.

Extra line break here, should this be removed?

Comment thread src/main/java/Pony.java Outdated
} else {
System.out.println("Here are the tasks in your list:");
for (int i = 0; i < this.tasks.size(); i++) {
int sn = i + 1;

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 a intuitive name for variable sn?

Comment thread src/main/java/Pony.java Outdated
myPony.initialise();
myPony.run();
}
}

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 like where you throw exceptions for each commands and how you added comments for each command which made reading your code easier.

Comment thread src/main/java/Pony.java Outdated
@@ -0,0 +1,195 @@
import java.util.Scanner;
import java.util.ArrayList;
public class Pony {

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 a line break to separate line 2 and line 3?

Comment thread src/main/java/PonyException.java Outdated
@@ -0,0 +1,33 @@
import java.lang.RuntimeException;
public class PonyException {

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 a line break to separate both lines?

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

Detailed comments make your code very easy to understand.

Comment thread src/main/java/Pony.java Outdated
run();
}
} else if (action.equals("todo")) {
// tod0 expects task description in command[1]

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 use "to-do" to prevent the text to be marked green.

Comment thread src/main/java/Pony.java Outdated
private void processCommand(String[] command) {
int commandSize = command.length;
String action = command[0];
if (action.equals("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.

Maybe using switch instead of if-else can make your code neater?

Comment thread src/main/java/Pony.java Outdated
} catch (NumberFormatException e) {
System.out.println(new PonyException.taskInputError().getMessage());
} finally {
run();

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 like how you carefully clean up your program after handling exceptions. 👍

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

Good job! All the best for the upcoming weeks

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

//Task to mark not provided
public static class taskMissingError extends RuntimeException {

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 could make these Errors extend PonyException instead

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

public static void main(String[] args) {
Pony myPony = new Pony();

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Since only one Pony object is created, why not make everything static instead?

Comment thread src/main/java/Pony.java Outdated
run();
}
} else if (action.equals("unmark")) {
// unmark expects input in command[1] -> which task to unmark

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 comment 👍🏾

ciaoosuuu and others added 16 commits September 19, 2022 17:55
Response from pony is not friendly to user.

Change some of the pony's response to a more friendly tone.
Find command is case sensitive.

A case insensitive find is more user-friendly because users cannot be
expected to remember the exact case of the keywords.

Let's update the search algorithm by converting all
strings to lowercase and find matches in lowercase.
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