-
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
[JThh] ip #364
base: master
Are you sure you want to change the base?
[JThh] ip #364
Conversation
# Conflicts: # src/main/java/Duke.java
# Conflicts: # src/main/java/Duke.java
# Conflicts: # src/main/java/Duke.java
Update Duke.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.
The code is neatly written and the switch statement is methodic.
The classes present like Task has been abstracted out so splitting them into different files will not be too troublesome and will be easy for you.
src/main/java/Duke.java
Outdated
DateTimeFormatter read_fmt = DateTimeFormatter.ofPattern("yyyy-MM-dd HHmm"); | ||
DateTimeFormatter print_fmt = DateTimeFormatter.ofPattern("MMM dd yyyy"); | ||
try { | ||
LocalDate lt = LocalDate.parse(s, read_fmt); |
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 possible to make the argument more expressive?
src/main/java/Duke.java
Outdated
|
||
@Override | ||
public String toString() { | ||
return "[D]" + super.toString() + " (by: " + 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.
To keep it simple you can use string formatting to prevent accumulation of '+' in string concatenation
int i = 461012;
System.out.format("The value of i is: %d%n", i);
src/main/java/Duke.java
Outdated
|
||
public static 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.
good job at consistent naming of the booleans!
src/main/java/Duke.java
Outdated
public class Duke { | ||
public static ArrayList<Task> todos = 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.
Good naming of arrays and making them plural!
src/main/java/Duke.java
Outdated
import java.util.Scanner; | ||
import java.io.File; | ||
|
||
|
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.
remember to separate the files and provide javadoc when you reach the appropriate stages 😄
src/main/java/Duke.java
Outdated
@@ -96,6 +96,7 @@ public DukeEmptyTaskException (String msg) { | |||
public static String parse_date(String s) { |
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.
Instead of "parse_date", perhaps you could rename it to "parseDate", which conforms to the coding standard?
Command class was used without being instantiated for convenience But this would cause security threats to passed arguments such as task list Let's make the command instantiable and make its methods non-static, and hence its attributes can be better protected and there is no need to pass them every time Using private attributes instead of public adds another layer of protection
Enhance code quality and add README.md
DukeBro
What you need to be successful is simply a task manager - helps you take down all your deadlines and not miss any of them.
All 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: