-
Notifications
You must be signed in to change notification settings - Fork 19
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
Level 1 to 3 (Week 2) #1
base: master
Are you sure you want to change the base?
Conversation
Level 5 created on branch To Update master branch with Level 5 increment.:wq
src/main/java/CommandHandler.java
Outdated
|
||
public class commandHandler { | ||
DisplayHandler DisplayUnit = new DisplayHandler(); | ||
InputParser InputUnit = new InputParser(); |
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.
According to the naming convention, Variable names must be in camelCase.
displayUnit, inputUnit and etc.
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 pointing this out. I missed this while refactoring.
src/main/java/InputParser.java
Outdated
@@ -1,4 +1,4 @@ | |||
public class inputParser { | |||
public class InputParser { | |||
|
|||
// Check if First Word is Keyword | |||
public boolean checkIfKeyWord(String Input) { |
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.
if is boolean, hasKeyword/isKeyword would be a better naming?
InputParser.isKeyword("abc").
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.
Yes. Indeed it would be. Thank you.
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 CommandHandler to check for keyword. Good JOb
src/main/java/duke/Duke.java
Outdated
displayHandler.DisplayInvalidInput(); | ||
// If input is a recognised Keyword | ||
else | ||
command.checkCommandType(keyWord, body, 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.
Is it good to have curly brackets for if-else statement
|
||
return task; | ||
|
||
} catch (NumberFormatException e) { } catch (ArrayIndexOutOfBoundsException 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.
Is it good to have error message in the bracket?
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.
Is it good to rearrange the second catch below the first catch statement?
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.
Hello! Overall your code quality is really good and I detected no coding violations 👍 I've some comments for your consideration/ review.
import duke.input.InputHandler; | ||
import duke.input.InputParser; | ||
import duke.output.DisplayHandler; | ||
import duke.storage.ListHandler; |
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 ordering of the import statements could be reworked to align with the instantiation and dependencies below just before the while loop and inside of it as well ?
@@ -0,0 +1,11 @@ | |||
package duke.command; | |||
|
|||
public enum KEYWORD { |
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 we can use the PascalCase here for enum ?
Reference: https://se-education.org/guides/conventions/java/index.html#naming
To Merge Branch Level 6 with Master
Merging branch-Level-7 with master .
branch-A-JUnit - (add Junit testcases)
Individual project. Duke. Pull Request. Week 2 Submission.
Based upon: https://nus-tic4001-ay2021s1.github.io/website/schedule/week3/project.html