-
Notifications
You must be signed in to change notification settings - Fork 78
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Jiayan Ben] iP #76
base: master
Are you sure you want to change the base?
[Jiayan Ben] iP #76
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks nice.
Just need to fix some of the names.
src/main/java/Duke.java
Outdated
Task[] list = new Task[100]; | ||
int count = 0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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; |
src/main/java/Task.java
Outdated
public void Done(){ | ||
this.isDone = true; | ||
} | ||
|
||
public void unDone(){ | ||
this.isDone = false; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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; | |
} |
src/main/java/Duke.java
Outdated
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like that you checked whether the task position is there or not.
src/main/java/Duke.java
Outdated
break; | ||
|
||
case "todo": | ||
// command e.g. todo borrow book |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like that you put the example inputs for each type of tasks.
src/main/java/Deadline.java
Outdated
@@ -0,0 +1,14 @@ | |||
public class Deadline extends Task { | |||
|
|||
protected String by; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Confusing variable name, use noun for variables.
protected String by; | |
protected String userName; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for your suggestions. I have improved the naming for a few variables to avoid confusion.
src/main/java/Duke.java
Outdated
String command = scanner.nextLine(); | ||
String[] parts = command.split(" "); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unspecific variable naming.
String command = scanner.nextLine(); | |
String[] parts = command.split(" "); | |
String userCommand = scanner.nextLine(); | |
String[] userInputParts = userCommand.split(" "); |
src/main/java/Todo.java
Outdated
public String toString() { | ||
return "[T]" + super.toString() ; | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good use of inheritance in implementation of toString().
src/main/java/Duke.java
Outdated
break; | ||
|
||
case "mark": | ||
int taskNo = Integer.parseInt(parts[1]); //assume saved in part[1], need further improve |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Comment could be more specific, and dumb downed for the reader instead of for own purpose.
src/main/java/Duke.java
Outdated
|
||
case "deadline": | ||
// command e.g. deadline return book /by Sunday | ||
String[] ddlSplit = command.split("/"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Avoid using short forms as variable names as it might confuse readers with different backgrounds.
src/main/java/Duke.java
Outdated
|
||
while (true) { | ||
String command = keyboard.nextLine(); | ||
String[] commendSplits = command.split(" "); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Small typo on "commendSplits"
src/main/java/Task.java
Outdated
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.