-
Notifications
You must be signed in to change notification settings - Fork 437
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
[Chu Yi-Ting] iP #426
base: master
Are you sure you want to change the base?
[Chu Yi-Ting] iP #426
Conversation
Classes related to Duke do not meet the coding standard. A package named Duke is created to refactor the classes. Classes related to Duke should all be packaged into a single package, by doing so, classes related to Duke is encapsulated. Refer to Package tutorial on GeeksForGeeks https://www.geeksforgeeks.org/packages-in-java/
Use a csv file as database.
Define standard format for Date.
This reverts commit 1293c7a.
# Conflicts: # src/main/java/duke/DukeCommandMatcher.java # src/main/java/duke/tasks/SingletonTaskList.java # src/main/java/duke/utils/Constants.java # src/main/java/duke/utils/UtilFunction.java
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.
LGTM! Overall, I thought the coding standard was really good! There were no arrow heads and the code was easy to read. I have some minor suggestions, but other than that, I feel that it's good.
} | ||
|
||
|
||
public String matchCommand(String command) throws CommandNotFoundException, NullCommandException, |
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 method might be a little long?
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.
Yeah, it does not look nice, but because of the same behaviour that Duke would respond to all these exceptions, I decide to throw all of them and handle it together in the highest level. Thanks for the suggestion.
src/main/java/duke/ui/Ui.java
Outdated
* @throws IllegalStateException | ||
* @see IllegalStateException | ||
*/ | ||
public static void loop(Storage database) throws IllegalStateException { |
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.
loop as a method name, could it be a little vague?
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, as I imagine a working application is something that is looping all the time until you shut it down. Any better suggestions for the name>
* Real all the tasks from the database. | ||
* @return the list of all the tasks from the database | ||
*/ | ||
public List<Task> readAll() { |
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.
Method name might be a little vague? Since the method returns a list.
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, yeah, I kind of follow the idea of CRUD (the read), as this method scans through the database, therefore I name it readAll. Any suggestions?
} | ||
} | ||
|
||
private static void lineSentence(String sentence) { |
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 method names can be verbs or actions?
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.
Hahaha, I spent few minutes pondering on the name of this method, as what it does is basically "auto-change-line" if the sentence is longer than the console (the same as wrapText). I did not know how to name it at that time, I guess ill follow the JavaFX convention. thanks for the suggestion
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.
looks great! keep it up :)
* @throws CommandNotFoundException | ||
* @throws NullCommandException | ||
* @throws LackOfTimeException | ||
* @throws NullCommandContentException | ||
* @throws TaskOutOfBoundException | ||
* @throws TaskNotSpecifyException | ||
* @throws DateFormatException |
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 should specify when these exceptions are thrown!
eg @throws CommandNotFoundException If the user command is not in the command list
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.
Thanks for the remind, I forgot to leave a readable note for them. Will add soon.
} | ||
|
||
private String handleExit() { | ||
System.out.println("Farewell/再見/さようなら~~"); |
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.
귀여워요 haha
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 suggestion haha
switch (taskStr[0]) { | ||
case "T": { | ||
task = new ToDo(taskStr[2], taskStr[1]); | ||
break; | ||
} | ||
case "E": { | ||
task = new Event(taskStr[1], taskStr[2], taskStr[3]); | ||
break; | ||
} | ||
case "D": { | ||
task = new Deadline(taskStr[1], taskStr[2], taskStr[3]); | ||
break; | ||
} | ||
default: { | ||
task = null; | ||
break; | ||
} | ||
} |
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.
those curly braces are unnecessary! i think the code would look cleaner without them~
/** | ||
* Exit pattern of the exit command for Duke. | ||
*/ | ||
public static final String EXITPATTERN = ("^(b|B)(y|Y)(e|E)$"); |
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 should use underscores to separate words! also, associated constants (final variables) should be prefixed by a common type name
eg PATTERN_EXIT
, PATTERN_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.
Ahh, right, that is a part of the coding standard, I forgot about it, yeah, maybe I'll also consider changing it into an Enum class, thanks.
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 I like your coding style and your code generally follows the coding standard. Just some nits to fix!
private String duration; | ||
|
||
/** | ||
* Default constructor for a new event object. |
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 there be a space between the description and param section?
Add assertions
Start CI
Create gradle.yml
The listener was still enabled after "bye" command. The listener is disabled after "bye".
Add command instruction to README.
No description provided.