-
Notifications
You must be signed in to change notification settings - Fork 228
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
[Kuek Yan Ling] iP #248
base: master
Are you sure you want to change the base?
[Kuek Yan Ling] iP #248
Conversation
src/main/java/Duke.java
Outdated
System.out.println("added: " + input); | ||
} else { | ||
for (int i = 1; i <= lst.size(); i++) { | ||
System.out.println(i + ". " + lst.get(i-1)); |
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 there should be whitespace on the left and right of the "-" sign? (:
list.get(i - 1);
src/main/java/Duke.java
Outdated
@@ -1,10 +1,189 @@ | |||
import java.util.*; |
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 imported classes should be listed explicitly? (:
src/main/java/Duke.java
Outdated
} | ||
|
||
|
||
static void level2() { |
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 method names could be more descriptive? In verb form? (:
src/main/java/Duke.java
Outdated
|
||
} | ||
|
||
|
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 more javadoc comments for the methods? (:
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 personally think that access modifier should be included for all methods so that readers can know whether the method should be accessed from outside the class, can be clearer for the readers.
src/main/java/DeadlineTask.java
Outdated
|
||
protected String deadline; | ||
|
||
public DeadlineTask(String description, String deadlline) { |
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 there is a typo for a variable name for deadline rather than deadlline.
src/main/java/Duke.java
Outdated
@@ -1,10 +1,189 @@ | |||
import java.util.*; |
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.
importing tasks individually can be clearer.
src/main/java/Duke.java
Outdated
public class Duke { | ||
|
||
static void level1() { |
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 having a method name that briefly describes what it does would be clearer.
src/main/java/Duke.java
Outdated
System.out.println("added: " + input); | ||
} else { | ||
for (int i = 1; i <= lst.size(); i++) { | ||
System.out.println(i + ". " + lst.get(i-1)); |
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.
Not sure if I liked that the - does not have whitespace before and after it.
src/main/java/Duke.java
Outdated
} | ||
|
||
|
||
static void level3() { |
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 would personally an access modifier for my method to show whether it can be used outside the package or class.
src/main/java/Duke.java
Outdated
|
||
|
||
static void level3() { | ||
List<Task> lst = new ArrayList<>(); |
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 instead of lst, using tasks could be clearer to know what the list contains.
src/main/java/Duke.java
Outdated
|
||
Scanner sc = new Scanner(System.in); | ||
String input = sc.nextLine(); | ||
String[] inputArray = input.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.
perhaps rather than inputArray, you can have a plural form of the input to show that it has multiple parts.
src/main/java/Duke.java
Outdated
} | ||
} else if (inputArray[0].equals("todo") || inputArray[0].equals("deadline") || inputArray[0].equals("event")) { //adding a task | ||
Task task = new Task(""); | ||
String[] inputArr1; |
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 extracting all the code that deals with different types of tasks could make your code clearer.
src/main/java/Task.java
Outdated
@@ -0,0 +1,21 @@ | |||
public class Task { | |||
protected String description; | |||
protected boolean isDone; |
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 the name of this boolean, clearly tells me what it does.
src/main/java/DeadlineTask.java
Outdated
|
||
protected String deadline; | ||
|
||
public DeadlineTask(String description, String deadlline) { |
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 there can be Javadoc comments to tell readers how this method works.
src/main/java/Duke.java
Outdated
public class Duke { | ||
|
||
static void level1() { |
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 it would be clearer if this method name starts with a verb?
src/main/java/Duke.java
Outdated
Scanner sc = new Scanner(System.in); | ||
String input = sc.nextLine(); | ||
|
||
List<String> lst = new ArrayList<>(); |
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 parameter name can be something like commands? lst may sound a bit unclear to readers.
src/main/java/DeadlineTask.java
Outdated
@@ -0,0 +1,15 @@ | |||
public class DeadlineTask extends Task { |
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.
Maybe you can consider putting classes into packages.
# Conflicts: # src/main/java/Duke.java # src/main/java/FileManager.java # src/main/java/TaskList.java
…ExitCommand, DoneCommand, TaskdateCommand (Complete A-MoreOOP)
# Conflicts: # src/main/java/duke/Storage.java # src/main/java/duke/task/TaskList.java
…e current task list. (Complete BCD-Extension, C-DetectDuplicates)
Add assertions (Complete A-Assertions)
…h-BCD-Extension # Conflicts: # data/duke.txt
# Conflicts: # data/duke.txt # src/main/java/duke/Duke.java # src/main/java/duke/task/TaskList.java
# Conflicts: # src/main/java/duke/task/TaskList.java
No description provided.