[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
NappySprout
left a comment
There was a problem hiding this comment.
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.
| 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.
Is it possible to make the argument more expressive?
|
|
||
| @Override | ||
| public String toString() { | ||
| return "[D]" + super.toString() + " (by: " + by + ")"; |
There was a problem hiding this comment.
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);|
|
||
| public static class Task { | ||
| protected String description; | ||
| protected boolean isDone; |
There was a problem hiding this comment.
good job at consistent naming of the booleans!
|
|
||
|
|
||
| public class Duke { | ||
| public static ArrayList<Task> todos = new ArrayList<>(); |
There was a problem hiding this comment.
Good naming of arrays and making them plural!
| import java.util.Scanner; | ||
| import java.io.File; | ||
|
|
||
|
|
There was a problem hiding this comment.
remember to separate the files and provide javadoc when you reach the appropriate stages 😄
| @@ -96,6 +96,7 @@ public DukeEmptyTaskException (String msg) { | |||
| public static String parse_date(String s) { | |||
There was a problem hiding this comment.
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
mainmethod: