-
Notifications
You must be signed in to change notification settings - Fork 461
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
[John Benedict] iP #14
base: master
Are you sure you want to change the base?
[John Benedict] iP #14
Conversation
Implement a skeletal version of Duke that starts by greeting the user, simply echos commands entered by the user, and exits when the user types bye.
Add the ability to store whatever text entered by the user and display them back to the user when requested.
Add the ability to mark tasks as done. Optionally, add the ability to change the status back to not done.
Add support for tracking three types of tasks: 1. ToDos: tasks without any date/time attached to it e.g., visit new theme park 2. Deadlines: tasks that need to be done before a specific date/time e.g., submit report by 11/10/2019 5pm 3. Events: tasks that start at a specific time and ends at a specific time e.g., team project meeting on 2/10/2019 2-4pm
Use the input/output redirection technique to semi-automate the testing of Duke
Teach Duke to deal with errors such as incorrect inputs entered by the user
Use Exceptions to handle errors
Add support for deleting tasks from the list
Save the tasks in the hard disk automatically whenever the task list changes. Load the data from the hard disk when Duke starts up.
Teach Duke how to understand dates and times
Divide classes into packages
Tweak the code to comply with a coding standard
Give users a way to find a task by searching for a keyword.
Use checkStyle to detect coding style violations.
Add a GUI to Duke. Use the JavaFX technology to implement the GUI.
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, good effort to abstract out the classes and obeying the OOP principles! Just take note that the overall readability could be further improved; some indentations are not very consistent and may impede the readability. Also, the JavaDocs tends to be a little verbose; maybe you can use simpler sentences to summarise what the method is achieving. Otherwise, good effort! 😄
* The function returns the result of executing that command. | ||
* | ||
* @param command | ||
* Pass the command object to the run command method |
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.
This line of description should be in line with @param command, otherwise the indentation may look off. :)
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.
Ah thank you, I will take note of this!
* The enum duke.Duke commands. | ||
*/ | ||
public enum DukeCommands { | ||
/** |
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.
Perhaps you could remove the individual JavaDocs for every type of commands to reduce the clutter here.
} | ||
|
||
/** | ||
* Of deadline. |
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.
Maybe you want to elaborate on what the description "Of deadline" here means? :)
src/main/java/duke/domain/Task.java
Outdated
* @throws InvalidTaskSpecificationException | ||
* the invalid task specification exception | ||
*/ | ||
public static Task of( |
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.
Some of the indentations in the first part of this method; perhaps you might want to change some of it to improve the readability of the code? Otherwise, it may be mistaken as a form of "Deep Nesting".
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.
I see I will see what I can do
return Objects.hash(super.hashCode(), dateTime); | ||
} | ||
|
||
@Override |
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 that you're abiding to the Boolean naming standards here! :)
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.
Thank you!
public List<Task> load(String filePath) { | ||
try { | ||
ensureDataFileExist(filePath); | ||
List<Task> initTask = new ArrayList<>(); |
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.
Since this is a list of Task objects, the variable name should be "initTasks" instead. :)
* Filter the tasks that are after a certain date | ||
* @return A string containing the tasks that are after the datetime | ||
*/ | ||
public String outputTasksAfterString(LocalDateTime dateTime) { |
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.
Nice use of streams here. Well done!
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, your code is easy to read. Most of your method is short and concise but there are few part where the method is quite long and deeply nested. Perhaps can consider to shorten those method by separating some operation into different method?
src/main/java/duke/Duke.java
Outdated
*/ | ||
public class Duke { | ||
|
||
private static final String defaultFilePath = "src/main/java/duke/data/tasks.txt"; |
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.
Perhaps the naming of this constants should be in all uppercase?
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.
Hmm I see, thank you for pointing this out
src/main/java/duke/domain/Task.java
Outdated
Boolean isEvent = Objects.equals(type, "E"); | ||
Boolean isDeadline = Objects.equals(type, "D"); | ||
Boolean isTodo = Objects.equals(type, "T"); | ||
if (isEvent || isDeadline || isTodo) { | ||
if (isEvent || isDeadline) { |
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.
I like you done it in steps, by evaluating the boolean value first then use the evaluated value in the if statement. Avoid complicated expression and easier to read.
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.
Thank you!
* @param userInput | ||
* Get the user input | ||
*/ | ||
public BaseCommand parse(String userInput) |
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.
Maybe can find a way to shorten this method? eg : put some of the operation in separate method and call it in here?
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.
This is definitely one area of my code that could use refactoring, I will take note of this in the future
Task newDeadline = Task.of( | ||
"D", | ||
"0", | ||
deadlineTitle, | ||
deadline); |
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.
Perhaps put it in the same line to reduce the level of indentation to make it easier to read?
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.
Oh, I thought it was easier to read like this but I shall take note
Use assert feature (not JUnit assertions) to document important assumptions that should hold at various points in the code.
Improve code quality
A-CodeQuality
GitHub Actions will run custom workflow every time certain project events are triggered (e.g., when a PR is updated, or the master branch is updated). This workflow will help to automate mundane task like: * checking the compilation of the gradle project * checking the style of the project using checkstyle
Generate javadocs to fulfil checkstyle
Add the ability for the user to ask for help and what commands are available
Updated the ui of the duke bot so that it is more visually pleasing to the users
Updated the command messages so that the duke bot appears more unique and friendly
Aladdin Services
Aladdin frees your mind from 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
main
method: