-
Notifications
You must be signed in to change notification settings - Fork 364
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[NBQian] iP #312
base: master
Are you sure you want to change the base?
[NBQian] iP #312
Conversation
tasks input by the user can only be saved while Duke is running and will be gone once Duke stops running Create a data folder with a task.txt file in it to permanently store all tasks Additionally: 1. changed line break style 2. added different greeting messages depending on the existence of data folder and/or tasks.txt file
this means locally saved tasks are not constantly updated whenever the list changes modified Main method such that changes are immediately reflected locally
…allow me to switch to master branch
this is not very flexible in terms of manipulating the way in which date and time is printed. Change Task subclasses such that they store date and time as java.time.LocalDateTime
* branch-Level-8: Task subclasses store time as a String # Conflicts: # src/main/java/Duke.java
* commit '556af3f47a96b32898ab4cdbd65b16486a4871e8': Add Gradle support
…ent files and packages.
This reverts commit 6b07de7.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well organised, sorry I don't really understand the extra things you did so no comment on those.
try { | ||
storage.update(tasks); | ||
} catch (IOException e) { | ||
System.out.println("failed to update tasks locally: " + e.getMessage()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Line break for better readability, happens in other files as well
/** | ||
* a list of valid Commands as enum | ||
*/ | ||
public enum CommandType { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good use of enums
package duke.dukeexception; | ||
|
||
/** | ||
* class that handles exceptions unique to the Duke application |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Capitalise first letters to be more formal
try { | ||
tasks.get(taskNumber - 1).mark(); | ||
} catch (Exception e) { | ||
throw new DukeException( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
More layman exception message would be nice
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall, the structure of the code is clean and readable. Just a few nitpicks few javadocs and capitalizations.
*/ | ||
public class ByeCommand extends Command { | ||
/** | ||
* determines that user wants to exit the program |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't the first letter of the description be in caps?
* determines that user wants to exit the program | |
* Determines that user wants to exit the program |
} | ||
|
||
/** | ||
* on execution, prints goodbye message |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same goes for this and some other methods in other classes,
* on execution, prints goodbye message | |
* On execution, prints goodbye message |
/** | ||
* a method that loads the local tasks into the TaskList if they exist. prints customised | ||
* messages if the file and/or folder does not exist, and create them accordingly | ||
* @return an empty ArrayList of Tasks if no local tasks are found, or an ArrayList | ||
* containing all local tasks if they are found. | ||
*/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You might want to add a @throws comment in this jdoc,
/** | |
* a method that loads the local tasks into the TaskList if they exist. prints customised | |
* messages if the file and/or folder does not exist, and create them accordingly | |
* @return an empty ArrayList of Tasks if no local tasks are found, or an ArrayList | |
* containing all local tasks if they are found. | |
*/ | |
/** | |
* a method that loads the local tasks into the TaskList if they exist. prints customised | |
* messages if the file and/or folder does not exist, and create them accordingly | |
* @return an empty ArrayList of Tasks if no local tasks are found, or an ArrayList | |
* containing all local tasks if they are found. | |
* @throws ... | |
*/ |
} | ||
|
||
/** | ||
* @return all the tasks row by row |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
might want to give a brief description of this method.
…o have assertion to check if the output messages are correct The lack of assertion can leave inaccurate output messages unchecked Adding assertion can ensure that the output messages are accurate Let's java assertion to each class with unique error message should the assertion fail. For example, if the output message of FindCommand is inaccurate, a message "wrong find message" will be output. Additionally, a get() method is added to TaskList class to facilitate addition of assertion to the above classes.
there are redundant code that is no longer useful. For example, the Status attribute and some output messages the name of the method "update" is not meaningful enough. readers of the code might get confused when reading the code removing the unused attribute and output messages increases the readability of the code Let's remove the redundant lines and refactor the method "update" to "updateLocal" Class Duke method "getLoadStatus" is no longer used because the Status attribute in Storage is removed removing this method prevents error from occurring Let's remove the unused method getLoadStatus()
…ommand, FindCommand, MarkCommand, ListCommand, CommandType, DukeException, Parser, Storage, Deadline, Event, Task, Todo, TaskList, Ui. Header comments are not in accordance with the format specified in the coding standard. Comments in the wrong format makes it harder for the readers to understand various methods Let's change the problematic comments in accordance with the format specified in the coding standard Additionally, unused method "readCommand" in Ui class is removed.
…mand "==" is used to compare Strings in the java assertions This may result in the assertion returning false even when the Strings look the same This can complicate the debugging process when an assertions gives an error Let's replace "==" with the .equals() method in java assertions for Strings.
Branch a assertions
Branch a code quality
…o branches merged, so I'm adding back that method.
Somehow the get method in TaskList magically disappeared after the tw…
…anged font for text at the input window. Updated welcome message
DUKE
Duke helps you organise different types of tasks to keep you on track. Tasks include:
Duke has the following functions:
removetasks from your planyou can check the source code here
for java programmers, want to know how the code that runs the program,
run
looks like 😃? Here you are:Features:
Managing tasks
Managing deadlines
Reminders (coming soon)
And it is FREE!