[Jiayan Ben] iP#76
Conversation
StanleyW00
left a comment
There was a problem hiding this comment.
Looks nice.
Just need to fix some of the names.
| Task[] list = new Task[100]; | ||
| int count = 0; |
There was a problem hiding this comment.
Perhaps the variable names should be renamed specifically to task in order to avoid confusion in the future.
| Task[] list = new Task[100]; | |
| int count = 0; | |
| Task[] tasks = new Task[100]; | |
| int tasksCount = 0; |
| public void Done(){ | ||
| this.isDone = true; | ||
| } | ||
|
|
||
| public void unDone(){ | ||
| this.isDone = false; | ||
| } |
There was a problem hiding this comment.
Perhaps these methods should be renamed to represent verbs.
| public void Done(){ | |
| this.isDone = true; | |
| } | |
| public void unDone(){ | |
| this.isDone = false; | |
| } | |
| public void markAsDone(){ | |
| this.isDone = true; | |
| } | |
| public void unmarkAsDone(){ | |
| this.isDone = false; | |
| } |
| if( (task > count ) || (task <1) ){ | ||
| System.out.println("Oops! You don't have the task in this positions."); | ||
| } |
There was a problem hiding this comment.
I like that you checked whether the task position is there or not.
| break; | ||
|
|
||
| case "todo": | ||
| // command e.g. todo borrow book |
There was a problem hiding this comment.
I like that you put the example inputs for each type of tasks.
| @@ -0,0 +1,14 @@ | |||
| public class Deadline extends Task { | |||
|
|
|||
| protected String by; | |||
There was a problem hiding this comment.
Confusing variable name, use noun for variables.
| protected String by; | |
| protected String userName; |
There was a problem hiding this comment.
Thanks for your suggestions. I have improved the naming for a few variables to avoid confusion.
| String command = scanner.nextLine(); | ||
| String[] parts = command.split(" "); |
There was a problem hiding this comment.
Unspecific variable naming.
| String command = scanner.nextLine(); | |
| String[] parts = command.split(" "); | |
| String userCommand = scanner.nextLine(); | |
| String[] userInputParts = userCommand.split(" "); |
| public String toString() { | ||
| return "[T]" + super.toString() ; | ||
| } | ||
| } |
There was a problem hiding this comment.
Good use of inheritance in implementation of toString().
| break; | ||
|
|
||
| case "mark": | ||
| int taskNo = Integer.parseInt(parts[1]); //assume saved in part[1], need further improve |
There was a problem hiding this comment.
Comment could be more specific, and dumb downed for the reader instead of for own purpose.
|
|
||
| case "deadline": | ||
| // command e.g. deadline return book /by Sunday | ||
| String[] ddlSplit = command.split("/"); |
There was a problem hiding this comment.
Avoid using short forms as variable names as it might confuse readers with different backgrounds.
|
|
||
| while (true) { | ||
| String command = keyboard.nextLine(); | ||
| String[] commendSplits = command.split(" "); |
| if( (taskNo > taskCount ) || (taskNo <1) ){ | ||
| System.out.println("Oops! You don't have any task in this positions."); | ||
| }else if(this.isDone){ | ||
| System.out.println("You have already completed the task."); | ||
| } else{ |
There was a problem hiding this comment.
Spacing of the if else statements does not follow standards. Similar in other areas
…adability of the main(Duke) class - ready to trackle exception
- Seperate files into different package for easier management
-add file and data checker methods
if files or folder not exist, create one;
if failed to create, throw error for incorrect path
-add backup method to save all currect data in current run of program
-correct bugs on fileIO over creating new task or delete task
…e to collect task data
…ng when the file is not empty
A-JavaDoc
No description provided.