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

[lckjosh] iP #74

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

[lckjosh] iP #74

wants to merge 37 commits into from

Conversation

lckjosh
Copy link

@lckjosh lckjosh commented Sep 5, 2023

No description provided.

switch (command) {
case "list":
if (noOfTasks == 0) {
System.out.println("____________________________________________________________");

Choose a reason for hiding this comment

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

Consider using a constant / final variable to represent the line divider

Comment on lines 41 to 46
int taskToMark = Integer.parseInt(parameters) - 1;
tasks[taskToMark].markAsDone();
System.out.println("____________________________________________________________");
System.out.println("I've marked this task as done:");
System.out.println(tasks[taskToMark].getStatusIcon() + " " + tasks[taskToMark].getDescription());
System.out.println("____________________________________________________________");

Choose a reason for hiding this comment

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

Consider moving code in cases to another function to reduce verbosity

String parameters = "";
Task[] tasks = new Task[100];
int noOfTasks = 0;
while (true) {

Choose a reason for hiding this comment

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

May cause an unintended program behaviour, consider setting the loop conditional to while the command is not bye

Comment on lines 59 to 62
System.out.println("____________________________________________________________");
System.out.println("Goodbye, hope to see you again soon!");
System.out.println("____________________________________________________________");
in.close();

Choose a reason for hiding this comment

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

Shift this to outside the loop and the condition becomes the loop condition

Copy link

@irving11119 irving11119 left a comment

Choose a reason for hiding this comment

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

Your code overall follows the coding standards and naming conventions. The only suggestion I have would to leave blank lines at certain points to separate out logic and make your code more readable.

Comment on lines 7 to 16
printUnderscores();
System.out.println("Hello from BotBuddy!");
System.out.println("What can I do for you?");
printUnderscores();
Task[] tasks = new Task[100];
String input;
String[] inputArr;
String command = "";
String parameters = "";
Scanner in = new Scanner(System.in);

Choose a reason for hiding this comment

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

Perhaps you could leave a blank line between certain lines to seperate related logic (e.g. a blank line after your print statements)

package BotBuddy;

public class BotBuddyException extends Exception {
public BotBuddyException(String s) {

Choose a reason for hiding this comment

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

Perhaps you could use a more descriptive variable than s such as inputString

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