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

[Alexander Lim] iP #74

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

Conversation

alexlim510
Copy link

No description provided.

Copy link

@NizarMohd NizarMohd left a comment

Choose a reason for hiding this comment

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

Overall, you have abided to the coding standard. There is a slight violation in terms of the if-else statement. You may refer to the individual comment on that. Good implementation of code quality. Maybe, for a slight improvement, you can add SLAP based on the individual comment that I have added!

Comment on lines 14 to 40
while (true) {
userInput = in.nextLine();
if (userInput.equals("bye")){
break;
}
else if (userInput.equals("list")){
listTasks(tasks, count);
}
else if (userInput.startsWith("done")){
markTaskAsDone(tasks, userInput);
}
else if (userInput.startsWith("todo")){
count = addTodoTask(userInput, tasks, count);
}
else if (userInput.startsWith("deadline")){
count = addDeadlineTask(userInput, tasks, count);
}
else if (userInput.startsWith("event")){
count = addEventTask(userInput, tasks, count);
}
else {
count = addGeneralTask(userInput, tasks, count);
}
}
System.out.println("Bye. Hope to see you soon!");
}

Copy link

@NizarMohd NizarMohd Feb 4, 2020

Choose a reason for hiding this comment

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

Maybe you can summarise this in a method in order to add SLAP to your main function. Also, in terms of coding quality, you may want to look up the coding standard for if-else statement.

Copy link

Choose a reason for hiding this comment

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

There is a glaring coding standard violation in this code :-p

Copy link
Author

Choose a reason for hiding this comment

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

Yes, I've noticed that I have made a mistake in the coding standard. Thanks for your input!

@@ -39,21 +32,29 @@ else if (userInput.startsWith("event")){
count = addEventTask(userInput, tasks, count);
}
else {
Copy link

Choose a reason for hiding this comment

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

It would be clearer if you can consider to wrap these if-else statements into "switch" cases

System.out.println("Hey! I am " + logo);
System.out.println("What would you like to do?");
displayWelcome(logo);
Copy link

Choose a reason for hiding this comment

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

These three codes seem that they can be all wrapped into "displayWelcome(logo)"

Copy link
Author

Choose a reason for hiding this comment

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

Thats a good idea, I will implement it into my code :)

Comment on lines 96 to 98
for (int j = 0; j<count; j++) {
System.out.println(j+1 + ". " + tasks[j]);
}
Copy link

Choose a reason for hiding this comment

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

In terms of coding standard, it would be better if you can consider to keep space consistency, i.e. for (int j = 0; j < count; j++)...

Copy link
Author

Choose a reason for hiding this comment

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

Well noted! 👍

Comment on lines 29 to 23
System.out.println("Nice! I've marked this task as done:");
System.out.println(" " + tasks[itemNumber-1]);
markTaskAsDone(tasks, userInput);
Copy link

Choose a reason for hiding this comment

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

It would be better if you can consider to wrap these "println"s into markTaskAsDone; similar suggestion for other command case

Copy link
Author

Choose a reason for hiding this comment

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

Thank you for your suggestion 👍

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.

5 participants