Conversation
…ction and it's exception handling
DannyDakota
left a comment
There was a problem hiding this comment.
few suggestions to naming conventions and coding standards for switch cases. Otherwise, solid work handsome!
src/main/java/TimeParse.java
Outdated
| this.helper(); | ||
| } | ||
|
|
||
| private LocalTime helper() { |
src/main/java/DateParse.java
Outdated
| this.helper(); | ||
| } | ||
|
|
||
| private LocalDate helper() { |
src/main/java/DukeException.java
Outdated
| * @param curr Holds the capacity for the stored list, used to check if request is out of bounds | ||
| * @throws DukeException | ||
| */ | ||
| public void checker(String[] arr, int curr) throws DukeException { |
There was a problem hiding this comment.
maybe can use a more descriptive name for the method 😄
e.g
commandChecker
stringChecker
inputTester
src/main/java/ReadFile.java
Outdated
| while (s.hasNext()) { | ||
| String[] inputLine = s.nextLine().split("\\| ", 4); | ||
| Task curr; | ||
| switch(inputLine[0]) { |
There was a problem hiding this comment.
switch cases shouldn't be indented according to the coding standard 😄
otherwise v nice use of switch to differentiate the various commands
pyk595
left a comment
There was a problem hiding this comment.
Overall, most of your code adheres to the coding standard, good job! Just a few minor nitpicks here and there
src/main/java/Deadline.java
Outdated
| protected TimeParse time; | ||
|
|
||
| /** | ||
| * Constructor for Deadline class |
There was a problem hiding this comment.
Might be better to put a line after the JavaDoc descriptor and the params?
src/main/java/Duke.java
Outdated
| @@ -1,10 +1,104 @@ | |||
| import java.io.FileNotFoundException; | |||
There was a problem hiding this comment.
Can consider putting your Duke.java in a package?
src/main/java/Duke.java
Outdated
| // If user inputs bye, terminate the program | ||
| if (input.equals("bye")) { | ||
| end = true; | ||
| } |
There was a problem hiding this comment.
Good use of in-line comments, they adhere to the coding standard's requirement as well
There was a problem hiding this comment.
Agreed! I like how you use in-line comments to help in code readability and understanding the code :)
src/main/java/ReadFile.java
Outdated
| */ | ||
| public class ReadFile { | ||
|
|
||
| public static final String ADDRESS = "data/duke.txt"; |
src/main/java/WriteFile.java
Outdated
| fw.close(); | ||
| } | ||
| // | ||
| // public static void main(String[] args) { |
There was a problem hiding this comment.
Can consider removing these few lines of code if they are not used?
src/main/java/Task.java
Outdated
| @@ -0,0 +1,31 @@ | |||
| public abstract class Task { | |||
| protected String description; | |||
| protected boolean isDone; | |||
src/main/java/ReadFile.java
Outdated
| case "T " : | ||
| curr = new Todo(inputLine[2]); | ||
| break; | ||
| case "D " : |
There was a problem hiding this comment.
Same thing as mentioned by @DannyDakota, indentation should be removed
src/main/java/WriteFile.java
Outdated
|
|
||
| public static final String ADDRESS = "data/duke.txt"; | ||
|
|
||
| public WriteFile(ArrayList<Task> store) throws IOException { |
There was a problem hiding this comment.
Store might not be the best name for a task list, maybe naming it taskList might be a better choice?
Tiffanylin21
left a comment
There was a problem hiding this comment.
Overall, I found some minor issues in naming. Otherwise, I really like the in-line comments in the code :)
src/main/java/DateParse.java
Outdated
| import java.time.LocalDate; | ||
| import java.time.format.DateTimeParseException; | ||
| import java.util.ArrayList; | ||
| import java.time.format.DateTimeFormatter; |
There was a problem hiding this comment.
Perhaps consider separating similar ones into blocks?
src/main/java/Deadline.java
Outdated
| this.dateInfo = this.date.toString() + " " + this.time.toString(); | ||
| } | ||
|
|
||
| public String whatType() { |
There was a problem hiding this comment.
Perhaps consider naming the method with verbs such as 'getType()'?
src/main/java/Duke.java
Outdated
| System.out.println("Hello from\n" + logo); | ||
| Scanner scanner = new Scanner(System.in); | ||
| String input = ""; | ||
| Boolean end = false; |
There was a problem hiding this comment.
Perhaps use a name that sounds more like a boolean? What about something like 'isEnd' or 'isExited'?
src/main/java/Duke.java
Outdated
| Scanner scanner = new Scanner(System.in); | ||
| String input = ""; | ||
| Boolean end = false; | ||
| ArrayList<Task> store = new ArrayList(100); |
There was a problem hiding this comment.
Perhaps consider using a plural noun as the name of the ArrayList?
src/main/java/Duke.java
Outdated
| // While loop ends when user inputs bye | ||
| while(!end) { | ||
| input = scanner.nextLine(); | ||
| String[] splitInput = input.split(" ", 2); |
There was a problem hiding this comment.
Perhaps consider using a plural noun as a variable name here?
src/main/java/Duke.java
Outdated
| // If user inputs bye, terminate the program | ||
| if (input.equals("bye")) { | ||
| end = true; | ||
| } |
There was a problem hiding this comment.
Agreed! I like how you use in-line comments to help in code readability and understanding the code :)
Event and Deadline tasks does not check for assumptions that string parsed as date and time are of correct size. Event and Deadline tasks would cause Jeff to crash if certain assumptions are not met. Let's add assertions on those very variables have been added, hence throwing an assertion failure instead of adding an invalid entry into the list. Assertions impact on performance is considered low compared to its benefits.
Parser class have repeated conditional statements to check if the user gave valid inputs. To improve readability and code quality. Let's refractor said conditional statements by extract them into methods. Easiest way to reuse code that have are duplicates of each other. Allows easy navigation as they are on the same class file.
Add Assertions
Improve Code Quality
Jeff the task manager
Jeff allows you to have all your to-dos in one easy to access location. It's,
fastSUPER FAST to use 🔥How do I get Jeff? It's as easy as,
And voilà, Jeff would do everything for you!
Features: