Skip to content
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

Open
wants to merge 86 commits into
base: master
Choose a base branch
from

Conversation

tototto
Copy link

@tototto tototto commented Aug 15, 2020

Individual project. Duke. Pull Request. Week 2 Submission.

Based upon: https://nus-tic4001-ay2021s1.github.io/website/schedule/week3/project.html


public class commandHandler {
DisplayHandler DisplayUnit = new DisplayHandler();
InputParser InputUnit = new InputParser();

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.

Copy link
Author

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.

@@ -1,4 +1,4 @@
public class inputParser {
public class InputParser {

// Check if First Word is Keyword
public boolean checkIfKeyWord(String Input) {

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").

Copy link
Author

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.

Copy link

@skyventus skyventus left a 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

displayHandler.DisplayInvalidInput();
// If input is a recognised Keyword
else
command.checkCommandType(keyWord, body, list);

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) { }

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?

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?

Copy link

@adi-kd0021 adi-kd0021 left a 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;

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 {

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants