Conversation
H-ZhanHao
left a comment
There was a problem hiding this comment.
The code was overall very neat and readable. Some nits to fix to make it even better.
src/main/java/TaskManager.java
Outdated
| private int taskCount; | ||
|
|
||
| public TaskManager(){ | ||
| tasks = new Task[100]; |
There was a problem hiding this comment.
Magic number used. A constant may help with readability in the future.
src/main/java/chatbot.java
Outdated
| public class chatbot { | ||
| public static void main(String[] args) { | ||
| Scanner in = new Scanner(System.in); | ||
| TaskManager taskManager = new TaskManager(); |
There was a problem hiding this comment.
Good idea to create a class for task management
src/main/java/chatbot.java
Outdated
| int index = Integer.parseInt(input.substring(5)) - 1; | ||
| taskManager.mark(index); | ||
| } else if (input.startsWith("unmark ")) { | ||
| int index = Integer.parseInt(input.substring(7)) - 1; |
There was a problem hiding this comment.
Get index could be abstracted into a function to make the code more readable here.
src/main/java/chatbot.java
Outdated
| String[] parts = input.substring(6).split("/from|/to"); | ||
| String description = parts[0].trim(); | ||
| String from = parts[1].trim(); | ||
| String to = parts[2].trim(); |
There was a problem hiding this comment.
Could the input filtering be abstracted to make this part more readable?
NCF3535
left a comment
There was a problem hiding this comment.
Overall the code is pretty clean readable, good job! Do try to use more OOP and note the coding standard violations to improve your code readably even more. Keep up the good work!
data/duke.txt.rej
Outdated
| @@ -0,0 +1,8 @@ | |||
| diff a/data/duke.txt b/data/duke.txt (rejected hunks) | |||
There was a problem hiding this comment.
Remove these unused files and use .gitignore so these files don't show up on GitHub. Alternatively, you may always use the version control to retrieve old versions of the code.
src/main/java/TaskManager.java
Outdated
|
|
||
| public TaskManager(){ | ||
| tasks = new Task[100]; | ||
| taskCount = 0; |
There was a problem hiding this comment.
Donot use magic numbers in the code. You can replace it with a constant so that it will improve readability.
src/main/java/TaskManager.java
Outdated
|
|
||
| private void loadFromFile() { | ||
| try { | ||
| File f = new File(FILE_PATH); |
There was a problem hiding this comment.
Use a better variable name as compared to f to improve readability.
src/main/java/TaskManager.java
Outdated
|
|
||
| Task t; | ||
| switch (type) { | ||
| case "T": |
There was a problem hiding this comment.
There should be no indentation for case clauses for switch cases unless you are using Lambda-style switch statements.
src/main/java/chatbot.java
Outdated
| } | ||
|
|
||
| try { | ||
| if (input.equalsIgnoreCase("list")) { |
There was a problem hiding this comment.
This area is very deeply nested and has a lot of repetition. You could probably use a switch to prevent this.
able to add date and time to deadline and event
able to search for tasks
added documentation
added user guide
No description provided.