[Fong Yih Jie] iP - #487
Conversation
Add Gradle support
# Conflicts: # src/main/java/duke/Storage.java # src/main/java/duke/TaskList.java # src/main/java/duke/Ui.java
# Conflicts: # src/main/java/duke/Parser.java # src/main/java/duke/TaskList.java
kelvinou01
left a comment
There was a problem hiding this comment.
Overall, the PR was pretty good, and adhered to the style guide! There were only some minor issues that I would like you to go over. Good job!
| protected TaskList tasks; | ||
| protected Parser parser; | ||
|
|
||
| private boolean runningDuke; |
There was a problem hiding this comment.
Would a proposition be a clearer name for this boolean? (e.g. dukeIsRunning ?)
| * @param verbose Boolean to indicate verbosity of Ui. | ||
| * @throws DukeException If command cannot be parsed or is invalid. | ||
| */ | ||
| public void parse(String command, boolean verbose) throws DukeException { |
There was a problem hiding this comment.
Would a proposition be a clearer name for the boolean parameter? (e.g. isVerbose)?
| * @throws DukeException If command cannot be parsed or is invalid. | ||
| */ | ||
| public void parseTwo(String command) throws DukeException { | ||
| String[] split = command.split(" ", 2); |
There was a problem hiding this comment.
Would a plural name be a better name for an array?
| String[] split = command.split(" ", 2); | ||
| String commandName = split[0]; | ||
| int id = tasks.getSize(); | ||
| if (split.length > 1){ |
There was a problem hiding this comment.
Nothing major, but whitespace between ){ would be nice! May I suggest running checkStyle before submitting, it has made my life a lot easier!
| * @throws DukeException If command cannot be parsed or is invalid. | ||
| */ | ||
| public void parseFind(String command) throws DukeException { | ||
| String[] split = command.split(" ", 2); |
| * Class that stores and manipulates tasks for Duke Bot. | ||
| */ | ||
| public class TaskList { | ||
| protected final ArrayList<Task> taskList; |
There was a problem hiding this comment.
Would a name like tasks be more concise?
| /** | ||
| * Marks current Task as done. | ||
| */ | ||
| public void done() { |
There was a problem hiding this comment.
Will a verb be more apt for this method name?
| /** | ||
| * Marks current Task as not done. | ||
| */ | ||
| public void undone() { |
ErvinK123
left a comment
There was a problem hiding this comment.
A few nits when naming variables, nothing major, should be good to merge when changed. 👍
| + "| |_| | |_| | < __/\n" | ||
| + "|____/ \\__,_|_|\\_\\___|\n"; | ||
| private Scanner sc; | ||
| private boolean verbose; |
There was a problem hiding this comment.
Perhaps a more intuitive variable name here?
| */ | ||
| public EventTask(String description) throws DateTimeParseException, DukeException { | ||
| super(); | ||
| this.commandString = description; |
There was a problem hiding this comment.
Perhaps an overloaded constructor for superclass Task can be looked into
| * Class that handles loading and saving of tasks for Duke Bot. | ||
| */ | ||
| public class Storage { | ||
| private FileWriter output; |
There was a problem hiding this comment.
Perhaps a more intuitive name could be used, that suggests the attribute is a filewriter
Included some assertions in Parser, Task and Storage class. These assertions should help to flag out bugs in these classes during runtime.
Improved on quality of code according to code quality guide. Removed instances of magic number and revised bad variable naming. This makes the code easier to read.
Add assertions
# Conflicts: # src/main/java/duke/Storage.java
Branch a code quality
Used a HashSet to store task strings for duplicate checking. Checking for duplicate via a HashSet is faster than checking for duplicates by iterating through an ArrayList.
Find command used to search using toString method of the tasks.
This will include (by:...) and (at:...) in the search. This will
mean that "find y" will return all deadlines and "find (" will
return all deadlines and events.
Storage used to save only after bye command. Now save after every modification to task list. Also updated storage file chick.txt to not store uncheck command as it is redundant. Duplicate check was missing in the implementation of removing the task from duplicate check after deleting the task from task list.
Storage used to save only after bye command. Now save after every modification to task list. Also updated storage file chick.txt to not store uncheck command as it is redundant. Duplicate check was missing in the implementation of removing the task from duplicate check after deleting the task from task list.
Changed backslash in userguide to forward slash.
DukePro
DukePro frees your mind of having 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 Java programmer, you can use it to practice Java too. Here's the
mainmethod: