-
Notifications
You must be signed in to change notification settings - Fork 362
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
[kenzantonius] iP #378
base: master
Are you sure you want to change the base?
[kenzantonius] iP #378
Conversation
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.
Coding standard is decent.
- Compliant with information hiding and encapsulation. No public class variables.
- Boolean variables start with "is".
- Indentation is strictly 4 whitespaces.
- Line length is never no longer than 120 chars.
- Strictly follows Egyptian style brackets and correct letter case for most names.
- Appropriate whitespaces within statements.
- All variables are initialized at declaration.
Some rooms for improvement:
- Minor naming errors.
- Should put every class in a package.
- Documentation plz 🥺
GJ!
src/main/java/Duke.java
Outdated
public class Duke { | ||
private Scanner scanner = new Scanner(System.in); | ||
private ArrayList<Task> list = new ArrayList<>(); | ||
private void 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.
Shouldn't this method name be in camelCase?
src/main/java/Duke.java
Outdated
} | ||
|
||
private String[] ErrorEventOrDeadline(String input, String textToReplace, String textToSplit) throws DukeException { | ||
String[] splitInput = input.replaceFirst(textToReplace, "") |
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 use plural form for array name?
src/main/java/Duke.java
Outdated
} | ||
} | ||
|
||
private String[] ErrorEventOrDeadline(String input, String textToReplace, String textToSplit) throws 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.
Maybe use verbs and camelCase for method names? Say, "makeErrEventOrDdl"
src/main/java/Duke.java
Outdated
public class Duke { | ||
private Scanner scanner = new Scanner(System.in); | ||
private ArrayList<Task> list = 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.
Maybe use plural form in a collection name? Like "tasks"?
src/main/java/Duke.java
Outdated
continue; | ||
} | ||
if (userInput.startsWith("deadline")) { | ||
String[] deadline = ErrorEventOrDeadline(userInput, "deadline", "/by"); |
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 use plural form for array name?
src/main/java/Duke.java
Outdated
continue; | ||
} | ||
if (userInput.startsWith("event")) { | ||
String[] event = ErrorEventOrDeadline(userInput, "event", "/at"); |
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 use plural form for array name?
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 job! Code is neat and follows coding standards
src/main/java/Deadline.java
Outdated
@@ -0,0 +1,14 @@ | |||
public class Deadline extends Task { | |||
|
|||
protected String by; |
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 change name from by to something that is a noun
src/main/java/Event.java
Outdated
@@ -0,0 +1,13 @@ | |||
public class Event extends Task { | |||
private String from; |
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.
similarly, conisder changing from to a noun
src/main/java/Task.java
Outdated
@@ -0,0 +1,26 @@ | |||
public class Task { | |||
protected String description; | |||
protected boolean isDone; |
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 following convention
Command classes have some complicated expressions. This might confuse the reader of the code. The expressions are changed into boolean variables with names that are self-explanatory so that the code can be easily understood. Other parts of the code already follow the code quality, so no changes are made.
Use Assertions.
Improve code quality.
DukePro
DukePro frees your mind of 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: