[Tin Jingyao] iP - #507
Conversation
There are 3 types of tasks, Todos, Events, and Deadline tasks
edricyeo
left a comment
There was a problem hiding this comment.
Generally good effort!
I like the clear naming of classes, variables and methods.
I think generally you could split your code into different classes, and include JavaDocs for your classes and methods!
| import java.util.Locale; | ||
| import java.util.Scanner; | ||
|
|
||
| public class Duke { |
There was a problem hiding this comment.
Perhaps apply OOP to split the Duke class into different smaller classes?
|
|
||
| private static final ArrayList<Task> LIST_OF_THINGS = new ArrayList<>(); | ||
|
|
||
| private abstract static class Task { |
There was a problem hiding this comment.
Maybe you could create Task as a separate class, instead of nesting it in the Duke class.
| } | ||
| } | ||
|
|
||
| private static class EventTask extends Task { |
There was a problem hiding this comment.
I like how you named the different Tasks clearly! 👍
| return false; | ||
| } | ||
| try { | ||
| Integer.parseInt(str.substring(7)); |
There was a problem hiding this comment.
Perhaps you could consider using str.split(" ") rather than str.substring(7). May improve reusability of code instead of having to change the number according to the length of the command?
|
|
||
| public class Duke { | ||
|
|
||
| private static final ArrayList<Task> LIST_OF_THINGS = new ArrayList<>(); |
There was a problem hiding this comment.
Maybe you could consider extracting this out as a separate TaskList class, which would handle adding tasks, etc.
domoberzin
left a comment
There was a problem hiding this comment.
Coding standard is generally adhered to w.r.t naming, but could extract out the different classes, as well as add JavaDocs. :)
| import java.util.Locale; | ||
| import java.util.Scanner; | ||
|
|
||
| public class Duke { |
There was a problem hiding this comment.
Could split the class into various classes, i.e. TaskList, Event, Deadline, instead of putting them into one class
| private static final ArrayList<Task> LIST_OF_THINGS = new ArrayList<>(); | ||
|
|
||
| private abstract static class Task { | ||
| private final String task_name; |
There was a problem hiding this comment.
Should be camelcase formatting for variables
| import java.util.Locale; | ||
| import java.util.Scanner; | ||
|
|
||
| public class Duke { |
There was a problem hiding this comment.
Could also add JavaDocs for documentation purposes
Shifted inner class Task to a new file
| public class Command { | ||
|
|
||
| } |
# Conflicts: # src/main/java/duke/Duke.java # src/main/java/duke/task/TodoTask.java
# Conflicts: # src/main/java/duke/Parser.java
# Conflicts: # text-ui-test/EXPECTED.TXT # text-ui-test/input.txt
Let's shorten excessively long methods by abstracting out certain parts into separate methods.
Add assert statements
# Conflicts: # src/main/java/duke/Parser.java
Branch a-code-quality
Flexibility to change the local file path through Duke allows users to set new file locations without restarting Duke. Users may also create new files this way.
Add some JavaDocs
DukePro
DukePro frees your mind of having to remember things you need to do. It's,
text-based
easy to learn
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
mainmethod: