[Tham Jin Lin] iP#288
Conversation
michaelseyo
left a comment
There was a problem hiding this comment.
Generally looks good except just some naming to be resolved.
| @@ -0,0 +1,23 @@ | |||
| public class Deadlines extends Task { | |||
There was a problem hiding this comment.
Perhaps the class name could be singular?
I like that you used inheritance for different types of Task.
| @@ -0,0 +1,23 @@ | |||
| public class Deadlines extends Task { | |||
| protected static String type = "[D]"; | |||
There was a problem hiding this comment.
Would it be better for the type to be static final and capitalized as in the coding standards for constants since this type won't be changing?
|
|
||
| exit(); | ||
| scanner.close(); | ||
| } catch (DukeException e) { |
There was a problem hiding this comment.
I like that you considered the many potential errors in the user inputs 😄
|
|
||
| while (!(isExit(command))) { | ||
| switch (command) { | ||
| case "list": |
There was a problem hiding this comment.
Just a reminder that the case could be indented in the same line as the switch command as in the coding standards
| String command = splitInput[0]; | ||
|
|
||
| while (!(isExit(command))) { | ||
| switch (command) { |
There was a problem hiding this comment.
Great that you used switch case and have modularized your code to perform the respective actions for the different conditions, looks neat!
DaneMarc
left a comment
There was a problem hiding this comment.
Looks good other than a few little details that should be easy to fix. Comments are missing.
|
|
||
| @Override | ||
| public String toString() { | ||
| return this.isDone ? "[D][X] " + this.description |
There was a problem hiding this comment.
Perhaps you could remove the 'this' keywords since the variables are not shadowed
| private static void addTask(Task task) { | ||
| taskList.add(task); | ||
| System.out.println("Got it. I've added this task:\n" + task.toString() + | ||
| "\nNow you have " + taskList.size() + " tasks in the list."); |
| @@ -0,0 +1,23 @@ | |||
| public class Deadlines extends Task { | |||
| protected static String type = "[D]"; | |||
Important assumptions mainly regarding validity of parameters exist in various methods of the different classes in Duke. Certain assumptions may not hold and that can cause the program to fail. Let's add assertions at every part of the code where important assumptions are being held to ensure that they hold true. Using assertions to document assumptions within the program allows the runtime to verify them. Upon assertion failure, the program typically terminates with an error message and this prevents possible bugs in the program from harming the program.
Branch A-Assertions
* 'master' of https://github.com/jltham/ip: Added assertions throughout the code base.
MarkCommand and UnmarkCommand are very similar in nature, sharing many lines of duplicated codes. Duplicated codes contributes to a longer code and possibly more issues arising due to more lines of code. Review process will be increasingly tedious as well. Let's abstract the functionality of Mark and Unmark to ChangeMark in TaskList, Storage and Ui.
Created new classes: ChangeMark to contain both Mark and Unmark.
Added update and clone functionalities.
Corrected file path for storage file creation.
Jin Lin's Duke
My duke helps you be lazy and lie in bed all day 🛌
It will
most definitely🤞Let me give you a step by step tutorial to it 🤪
Here, I'll give you a sneak peek to the most complex code, the
goatmethod ! 😵💫Alright that's enough giving from me ! Follow me for more content !