Skip to content

[CHEN ZIHAN] ip#198

Open
ZIZI-czh wants to merge 34 commits into
nus-cs2113-AY2223S2:masterfrom
ZIZI-czh:master
Open

[CHEN ZIHAN] ip#198
ZIZI-czh wants to merge 34 commits into
nus-cs2113-AY2223S2:masterfrom
ZIZI-czh:master

Conversation

@ZIZI-czh

@ZIZI-czh ZIZI-czh commented Jan 31, 2023

Copy link
Copy Markdown

this up to level 2

@stevenantya stevenantya left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall good job on the pull request! Only few minor consistency and coding standards issues.

Comment thread src/main/java/Duke.java Outdated
}



Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove the unnecessary blank spaces, follow one uniform spacing

Comment thread src/main/java/Duke.java Outdated



public static void add() {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Coding Standard violation: Ambiguity of function.

Can change the name of the function to explain more. e.g. addTodo()

Comment thread src/main/java/Duke.java Outdated

public static void add() {
boolean isByeEntered = true;
String outputs;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Coding Standard Violation: Plural form is reserved for collections of objects.

Suggested change
String outputs;
String output

Comment thread src/main/java/Duke.java Outdated
public static void add() {
boolean isByeEntered = true;
String outputs;
String[] storeList;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Coding Standard Violation: Array should be plural

Suggested change
String[] storeList;
String[] storeLists;

Comment thread src/main/java/Duke.java Outdated
return;
}else{
System.out.println(outputs);
} else if(outputs.equals("list")){

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Coding Standard Violation: Give space before and after statement

Suggested change
} else if(outputs.equals("list")){
} else if(outputs.equals("list")) {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same goes for line 30, 35

@kairuler kairuler left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall, I like how your code is quite clean and you adhered to coding standards most of the time! I noticed some variable names and spacing that you may have unintentionally overlooked but they are just minor errors. Good job!

Comment thread src/main/java/Duke.java Outdated

boolean isByeEntered = true;
String outputs;
public static final int MAX_INT = 100;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice! I like your usage of constants (instead of magic numbers) and I like how they are typed (all uppercase, underscore to separate words).

Comment thread src/main/java/Duke.java Outdated


public static void add() {
boolean isByeEntered = true;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could isByeEntered be named to sound more like a boolean variable? It is a bit confusing what isByeEntered does just based off its name 😁 .

Comment thread src/main/java/Duke.java Outdated
if(list!=null) {
System.out.println(a + ". " + list);
a++;
}else{

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Spacing is sometimes inconsistent (maybe by accident?). Here, }else{ has no spaces between the braces but elsewhere, there are spaces. I noticed this a few times in the above code too. Be sure to double check!

Comment thread src/main/java/Duke.java Outdated
public static void add() {
boolean isByeEntered = true;
String outputs;
String[] storeList;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like how your array specifier is attached to the type and not the variable 👍 nice

Comment thread src/main/java/Duke.java Outdated
String[] storeList;
storeList = new String[MAX_INT];
int i = 0;
int a = 1;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wasn't sure on what a did until I read the code fully... I think changing the variable name a could make it more understandable for readers!

Comment thread src/main/java/Duke.java Outdated
case "Bye":
System.out.println("Bye. Hope to see you again soon!");
isByeEnter = true;
break;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please separate into different methods to handle different commands, such as displayAllTasks(), UnmarkTask() etc.

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.

4 participants