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

[Maliha Haque] iP #427

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

Conversation

malihahaque
Copy link

No description provided.

Copy link

@lesterlimjj lesterlimjj left a comment

Choose a reason for hiding this comment

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

You are making good progress in catching up. Aside from a few minor coding violations and some long pieces of code, everything else look fine. Before you progress into later weeks of the IP, it would be good to install the checkstyle scripts from week 4 to help you check coding standard violation. Aside from that, configuring your IDE to fit the coding standard is available in week 2 or 3 so perhaps you can skim through and configure it now.


private static void printList() {
System.out.println("Here are the tasks in your list:");
for (int i=1; i<=list.size(); i++) {

Choose a reason for hiding this comment

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

Your operators (e.g. "=", "<=", "-") should be surrounded by space on both sides. This minor issues reappear a few times in other parts of your code(e.g. addTask(String) method).

unmarkTask(message);
} else if (firstWord.equals("delete")) {
deleteTask(message);
} else if (firstWord.equals("todo") || firstWord.equals("deadline") || firstWord.equals("event")){

Choose a reason for hiding this comment

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

Perhaps we can split into more if-else statements and make each task creation its own function?

@@ -0,0 +1,5 @@
public class LaraException extends Exception{

Choose a reason for hiding this comment

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

{ should have a white space preceding it.

@@ -0,0 +1,34 @@
import java.util.ArrayList;

public class Task {

Choose a reason for hiding this comment

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

Consider putting your object classes into packages (naming for packages need to be all lowercase). It is a week 3 IP requirement but it would be good to start doing it in earlier branches.

public class Task {
protected String description;
protected boolean isDone;
protected static int taskCounter=0;

Choose a reason for hiding this comment

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

Perhaps we can remove this if we do not plan to use it?

System.out.println(event);
}
System.out.println("Now you have " + list.size() + " tasks in the list.");
} catch (LaraException e) {

Choose a reason for hiding this comment

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

Do we need a try-catch for every task-related function call if we already have a try-catch in your if-else statements?

Copy link

@kylieluk88 kylieluk88 left a comment

Choose a reason for hiding this comment

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

other than some small issues like spacing and indexing, the code is clear and easy to understand! keep it up in the week 3 tasks

System.out.println("OK, I've marked this task as not done yet:");
System.out.println("[ ] " + list.get(taskNumber).getDescription());
} catch (LaraException e) {
System.out.println(e.getMessage());

Choose a reason for hiding this comment

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

This line should have another 4-space indentation. some of the spacing for the "}" brackets below also seem a bit inconsistent, can make use of IDEs which automatically adjust the indentation for you so you don't have to manually check :)

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.

3 participants