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

[Cocoanautz] ip #219

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

Conversation

cocoanautz
Copy link

@cocoanautz cocoanautz commented Jan 30, 2024

Drew, The chat-bot of all time.

"He who does not remember his tasks, will not do them." - Sun Tzu

Do you want to be:

  • Productive
  • Up to date
  • Great

If you answered YES to all the above, then Drew is The buddy for you!

All you need to do to achieve greatness is:

  1. Download the code from here.
  2. Start up the chat-bot.
  3. Key in your tasks.

Features include:

  • Cool pal to talk to 😎
  • No nonsense. Only do what you need to do. 💯

Look at how cool this response in the executeCommand method is:

int firstBackslashIndex = input.indexOf("/by");
if (firstBackslashIndex == -1) {
    throw new IllegalArgumentException("Incorrect input. Ensure that date begins with /by");
}

damithc and others added 19 commits January 7, 2024 18:33
Let's tweak the docs/README.md (which is used as the user guide)
to fit Duke better. Specifically,

1. mention product name in the title
2. mention adding a product screenshot and a product intro
3. tweak the flow to describe feature-by-feature
# Conflicts:
#	src/main/java/Duke.java
Date datatype in Deadline and Event objects have been updated from String to LocalDate to support more date related functions.
Moved the save and load functions out of the main method to decouple storage functionality from main logic. Storage is now accessed with filePath and Arraylist.
Refactored UI, Storage, Parsing and List functionality into respective packages and classes.
Copy link

@maze508 maze508 left a comment

Choose a reason for hiding this comment

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

LGTM. There are only some minor code quality issues that you can easily fix and missing javadocs for some of your classes and methods. Well Done!

this.isDone = false;
}
public String getStatusIcon() {
return (isDone ? "X" : " "); // mark done task with X
Copy link

Choose a reason for hiding this comment

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

Do not repeat in comments information that is already obvious from the code

throw new InsufficientArgumentsException("'Mark index' cannot be empty");
}
break;
//valid integer will be checked later
Copy link

Choose a reason for hiding this comment

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

Comments should target other programmers reading the code and not only make sense to the person who wrote it

* @param input String containing full user input.
* @return Command specified by user input.
*/
public static Command checkCommandIdentity(String input) throws UnknownCommandException,
Copy link

Choose a reason for hiding this comment

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

Avoid complicated expressions and definitions. Your method checkCommandIdentity gets the userCommand by checking for string equivalence, then uses the userCommand to perform a conditional switch case check. This can be combined into 1 and reduce redundant checkings and simplify your method to make it more easily readble

}
}

public static String executeCommand(ArrayList<Task> ls, String input) {
Copy link

Choose a reason for hiding this comment

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

Avoid Long Methods, you can consider calling another method to process your different userCommands

Unit tests currently cover Parser.checkCommandIdentity() and Storage.parseSave().

For checkCommandIdentity(), it tests whether the parser recognizes the identity of valid commands.

For parseSave(), it tests for corruption in status symbol, argument count and date format issues.
Copy link

@yongkotaro yongkotaro left a comment

Choose a reason for hiding this comment

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

Overall, the code followed the coding standard well with appropriate naming and statements. JavaDocs were missing for only 1-2 methods.


int inputLength = input.length();
Command userCommand;
if (inputLength == 3 && input.substring(0, 3).equalsIgnoreCase("bye")) {

Choose a reason for hiding this comment

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

Maybe could name input.substring(start, end) as "String command".

Comment on lines 21 to 24
System.out.println(DELIMITER);
System.out.println("Hello! I'm drew.Drew");
System.out.println("What can I do for you?");
System.out.println(DELIMITER);

Choose a reason for hiding this comment

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

Maybe could combine them into a constant String GREETING

protected String description;
protected boolean isDone;

public Task(String description) {

Choose a reason for hiding this comment

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

Could add JavaDocs, minor issue

return "[" + getStatusIcon() + "] " + description;
}

public abstract String toSaveFormatString();

Choose a reason for hiding this comment

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

Maybe could add a description.

cocoanautz and others added 23 commits February 11, 2024 16:22
Separated command execution logic from parser. Parser only checks for command identity now.
# Conflicts:
#	src/main/java/drew/Drew.java
#	src/main/java/drew/ui/Parser.java
Most of the classes and methods minor checkstyle issues related to:
1. Class JavaDocs
2. Import statement ordering
3. Coding standards.

Fixing these issues will increase code readability, as well as
ensure that styles are consistent across all files.
Asserts were added into some commands to ensure that variables
are within the expected values during runtime.

These changes would increase the reliability of the program.
The following extension have been added:
1. B-Reminders
2. C-DetectDuplicates

Reminders:
The chatbot would remind the user of any upcoming deadlines
whenever it starts.

DetectDuplicates:
The chatbot would prevent the user from creating tasks that already
exist.
Previously, Dialog boxes would terminate after 4 lines.
This commits removed max dialog box size.
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.

None yet

4 participants