[lordidiot] iP#527
Conversation
Respirayson
left a comment
There was a problem hiding this comment.
Looks good 👍
Just a few nitpicks here and there
| private static boolean handleInput(Parser parser, TaskList taskList, Ui ui) throws DukeException { | ||
| Task task; | ||
| switch (parser.getCommand()) { | ||
| case "bye": |
There was a problem hiding this comment.
perhaps it would be better to consider the case that the user might input the correct word but a different capitalisation? For eg. instead of bye, the user inputs Bye or BYE.
There was a problem hiding this comment.
Definitely, will work on that.
| ui.exit(); | ||
| } | ||
|
|
||
| private static boolean handleInput(Parser parser, TaskList taskList, Ui ui) throws DukeException { |
There was a problem hiding this comment.
I like the function in that it is succinct and it is very readable. However, I think you might want to consider refactoring the code and extracting this function into the Parser class as that class deals with making sense of the user commands.
| * Initialise UI. Prints banner. | ||
| */ | ||
| public void init() { | ||
| System.out.println("____________________________________________________________"); |
There was a problem hiding this comment.
Small thing but perhaps it would be better to turn the underline into a constant so it can be easily reused elsewhere
There was a problem hiding this comment.
Thank you! That makes sense, will do so.
| return new ArrayList<>(); | ||
| } | ||
|
|
||
| ArrayList<Task> tasks = new ArrayList<>(); |
There was a problem hiding this comment.
I like how you used tasks as the variable name for the Java Collections Object
| package duke.mocks; | ||
|
|
||
| import duke.Task; | ||
| public class TaskMock extends Task { |
There was a problem hiding this comment.
I really like the usage of stubs when performing your unit testing. Really shows you went the extra mile!
| * @throws DukeException Any errors encountered while storing | ||
| */ | ||
| public void storeTasks(List<Task> tasks) throws DukeException { | ||
| String serialized = tasks.stream() |
Minimise code reptition by replacing the dotted line string constants with a single static reference to a class constant DOTTED_LINE.
Add assertions
Refactor to improve code quality
A heading
🤓
a hyper link
inline code?some text formatting: bold, italic,
strikethroughetc.