-
Notifications
You must be signed in to change notification settings - Fork 438
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
[Kaitlyn] iP #461
base: master
Are you sure you want to change the base?
[Kaitlyn] iP #461
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.
Apart from a few easily correctable nits here and there, I think your project is going great! Once the JavaDoc is added in, everything should be even neater. Keep up the awesome work 😀
src/main/java/duke/ui/Ui.java
Outdated
import java.util.Scanner; | ||
|
||
public class Ui { | ||
private static final String logo = |
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 think the ASCII cat is really cute 👍 Maybe consider changing the variable name to all uppercase because it can be treated as a constant?
package duke.datetime; | ||
|
||
public enum DateTimeFormat { | ||
String, |
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 use of an enum to keep track of valid & invalid formats. Much better than using integer status codes. Perhaps these should be in uppercase as it is an enum? I noticed a few other variables in a similar position.
@@ -0,0 +1,12 @@ | |||
package duke.command; | |||
|
|||
public enum CMD { |
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 think enum names should be written in PascalCase based on the coding standard? 🤔
@@ -0,0 +1,25 @@ | |||
package duke.command; | |||
|
|||
import duke.*; |
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.
Would it be possible to avoid wildcard imports?
ArrayList<String> tasksStr = new ArrayList<>(); | ||
String str; | ||
reader.readLine(); | ||
while((str = reader.readLine()) != null) { |
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 add a space character after while
?
|
||
public class Parser { | ||
public static Command parse(String userInput) throws DukeException { | ||
int space_idx = userInput.indexOf(' '); |
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.
Should this be in camelCase instead?
} | ||
|
||
@Override | ||
public void execute(TaskList taskList, Ui ui, Storage storage) throws DukeException { |
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.
Do you think the nesting may be a bit deep here? I tend to find nested if-else hard to read when it goes down to 3-4 layers. One possible way of avoiding this:
if (taskList.isEmpty()) {
ui.display("UR LIST HAZ NUTHIN LOLOL");
return; // Stop the rest of the method from executing
}
if (by.isEmpty()) {
/* continue from here */
if (taskList.isEmpty()) { | ||
ui.display("UR LIST HAZ NUTHIN LOLOL"); | ||
} else { | ||
if (this.by.isEmpty()) { |
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 the this
keyword can be removed?
A-CodingStandard: Tweak the code to comply with a coding standard
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.
Overall I think most of the naming was quite well done! 👍
I just had some suggestions for 1/2 names which I didn't understand immediately.
import duke.ui.Ui; | ||
|
||
public class DeleteCommand extends Command { | ||
private int idx; |
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 change this to index
? In my opinion it's more understandable from the get go and it's not too many more characters 😉
} | ||
|
||
/** | ||
* Overloaded class constructor if a deadline is spceified for filtering out |
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.
Typo in 'specified' 🤣
} | ||
|
||
private static String tasks2String(ArrayList<Task> tasks) { | ||
String ret = ""; |
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.
Just a suggestion but I would name it as toReturn
instead :)
* @param msg | ||
* @return | ||
*/ | ||
public String fmtMsg(String msg) { |
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 you might consider changing it to formatMsg
instead?
Add A-Assertions
Revert "Add A-Assertions"
No description provided.