[Gibson0918] IP#375
Conversation
Guo-KeCheng
left a comment
There was a problem hiding this comment.
LGTM. Good job thus far. Jiayous.
| switch (userInput[0]) { | ||
| case "bye": | ||
| System.out.println("Bye. Hope to see you again soon!"); | ||
| sc.close(); | ||
| startDuke = false; | ||
| break; |
There was a problem hiding this comment.
Switch-case should not be indented. Could edit coding style in Intellij to reduce having to manually check.
| String[] userInput = sc.nextLine().split(" ", 2); | ||
|
|
||
| try { | ||
| switch (userInput[0]) { |
There was a problem hiding this comment.
Could potentially abstract out userInput[0] using enum
| protected LocalDateTime from; | ||
| protected LocalDateTime to; |
There was a problem hiding this comment.
perhaps startDate and endDate would be better names
| return "[E]" + super.toString() + " (from: " + from.format(DateTimeFormatter.ofPattern("MMM dd yyyy HH:mm")) + " to: " + to.format(DateTimeFormatter.ofPattern("MMM dd yyyy HH:mm")) + ")"; | ||
|
|
There was a problem hiding this comment.
this return statement could be indented better
| public boolean isTerminated() { | ||
| return isTerminated; | ||
| }; |
There was a problem hiding this comment.
there shouldn't be a semi colon at the end of a method
| public class ExitCommand extends Command { | ||
|
|
||
| @Override | ||
| public void initCommand(TaskList tasks, Ui ui, Storage storage) { |
There was a problem hiding this comment.
Good job making the code readable and easy to understand
| String[] output = command.split(" ", 2); | ||
| ValidCommands validCommands = ValidCommands.valueOf(output[0].toUpperCase()); | ||
| switch (validCommands) { | ||
| case LIST: |
There was a problem hiding this comment.
Remember that there should not be any indentation for case clauses :)
There was a problem hiding this comment.
otherwise, i like how it is very easy to understand what your parser is doing 👍
| String[] data = sc.nextLine().split(" \\| "); | ||
| Task task = null; | ||
| switch (data[0]) { | ||
| case "T": |
There was a problem hiding this comment.
Same issue with the indentation for switch case as mentioned earlier :)
| public List<Task> loadFile() throws FileNotFoundException { | ||
| List<Task> taskList = new ArrayList<>(); | ||
| File file = new File(filePath); | ||
| if (file.isFile()) { |
There was a problem hiding this comment.
Is it possible to avoid this deep nesting?
Remove Java Docs for methods that have been removed. Refactor Todo, Deadline and Event's toString() and formatForFile() method for better clarity. Removed unused method in the Ui Class
Tasks already added to Duke cannot be updated so an edit/update feature for existing task would be appreciated as the only way to modify a task would be to delete the existing one and create a new one. Let's modify the 3 tasks (Event, Todo, Deadline) and add an UpdateCommand class to support Duke in updating existing task
1. Resolve minor GUI bugs where the GUI was not resizing properly 2. Added the missed out set method in TaskList class
Added Assertions to Duke
Duke
Duke is a simple reminder app that helps you to remember things you need to do. It's,
FASTSUPER FAST to useAll you need to do is,
And it is FREE!
Features:
if you are a Java programmer, you can use it to practice Java too. Here's the main method: