Skip to content
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

Open
wants to merge 37 commits into
base: master
Choose a base branch
from
Open

[Kaitlyn] iP #461

wants to merge 37 commits into from

Conversation

kaitlynng
Copy link

No description provided.

Copy link

@w-yeehong w-yeehong left a 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 😀

import java.util.Scanner;

public class Ui {
private static final String logo =

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,

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 {

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.*;

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) {

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(' ');

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 {

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()) {

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?

Copy link

@jonfoocy jonfoocy left a 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;
Copy link

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
Copy link

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 = "";
Copy link

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) {
Copy link

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants