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

[Januarius Jang] iP #15

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

Conversation

JanuariusJang
Copy link

No description provided.


public Deadline (String description, String by){
super(description);
this.by=by;
Copy link

Choose a reason for hiding this comment

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

There should be a spacing between the assignment. ... I noticed the same issue in several other places too.

}
@Override
public String toString(){
return "[D]" + "["+ super.getStatusIcon()+ "]" + super.toString() + " (by: " + by + ")";
Copy link

Choose a reason for hiding this comment

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

Perhaps the return statement can be stored in a String with an appropriate name?


while(!textInput.equals("bye")) {

String[]arrayOfStr=textInput.split(" ",2);
Copy link

Choose a reason for hiding this comment

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

Perhaps give this a better name to give context to the String you are storing? ... I noticed the same issue in several other places too.

switch (arrayOfStr[0]) {
case "list":
for (int i = 0; i < taskList.size();i++)
{
Copy link

Choose a reason for hiding this comment

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

Java coding standard recommends Egyptian style braces


case "done":
int index=Integer.parseInt(arrayOfStr[1])-1;
taskList.get(index).markAsDone();
Copy link

Choose a reason for hiding this comment

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

Perhaps this can be broken down into multiple line for better readability?... I noticed the same issue in several other places too.


case "todo":
Task t=new Todo(arrayOfStr[1]);
taskList.add((t));
Copy link

Choose a reason for hiding this comment

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

There is no need for a double parentheses.


case "deadline":
String[]arrayOfDoneDetails=arrayOfStr[1].split("by ",2);
Task d=new Deadline(arrayOfDoneDetails[0],arrayOfDoneDetails[1] );
Copy link

Choose a reason for hiding this comment

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

Perhaps assign array elements into a variable with an appropriate name?


case "event":
String[]arrayOfEventDetails=arrayOfStr[1].split("at ",2);
//arrayOfDoneDetails[0] contains description, arrayOfDoneDetails[1] contains the date.
Copy link

Choose a reason for hiding this comment

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

Maybe remove redundant comments ?

BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
String textInput = reader.readLine();

while(!textInput.equals("bye")) {
Copy link

Choose a reason for hiding this comment

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

Innovative way of ending the continuous loop

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.

2 participants