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

[quelinxiao] ip #477

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

Conversation

quelinxiao
Copy link

@quelinxiao quelinxiao commented Feb 7, 2024

Bob

Why you should use Bob:

So you can work faster

  • Text-based
  • Easy to learn
  • FAST SUPER FAST to use

Steps to take:

  1. Download it here
  2. Open the file
  3. Start adding your tasks in 😄

It is completely FREE!

Features:

  • Manage tasks
  • Manage deadlines
  • Find

This is the main method:

public static void main(String[] args) {
        new Bob("./data/tasks.txt").run();
}

damithc and others added 11 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
@quelinxiao quelinxiao changed the title Add new functions to chatbot [quelinxiao] ip Feb 7, 2024
Copy link

@NewtonKoh NewtonKoh left a comment

Choose a reason for hiding this comment

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

LGTM. Small nits

@@ -31,7 +31,7 @@ else if (input.equals("list")) {
}
}

else if (input.trim().matches("mark|unmark|deadline|todo|event")) {
else if (input.trim().matches("mark|unmark|deadline|todo|event|delete")) {

Choose a reason for hiding this comment

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

Small nit. I believe the else if should be preceded by the closing curly brackets from the if/if else statement above it.

Copy link

@tanjiajiajun tanjiajiajun left a comment

Choose a reason for hiding this comment

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

Looks great to merge. Just small nits

String greet = " Hello! I'm Bob.\n"
+ " What can I do for you?\n";

String exit = " Bye. Hope to see you again soon!";

Choose a reason for hiding this comment

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

Consider changing this to a final String as the value of the greeting and exit phrase will not change

+ " Now you have " + taskList.size() + " tasks in the list.");
}

else if (input.startsWith("todo ")) {

Choose a reason for hiding this comment

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

Having spaces at the end of the string does not look very clean. Maybe can consider removing that.

*/
@Override
public String toString() {
return "[D]" + super.toString() + " (by: " + by + ")";

Choose a reason for hiding this comment

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

Clean way to handle output. I did not know that!

Copy link

@jovantanyk jovantanyk left a comment

Choose a reason for hiding this comment

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

Good attempt however please try and separate out your classes, they should not all be in the same java file. There's also almost no use of OOP here, you can create utility classes for handling Ui, Exceptions, Files, instead of storing them all inside methods.

data/bob.txt Outdated

Choose a reason for hiding this comment

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

Local data files like this should not be pushed onto remote

Choose a reason for hiding this comment

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

Maybe consider separating your code into different classes and packages :)

/*
* This class represents a task we want to record.
*/
class Task {

Choose a reason for hiding this comment

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

Different Classes should not be in the same .java file. Consider separating them into dedicated java files

*
* @return A boolean depending on whether the task is done.
*/
public boolean getIsDone() {

Choose a reason for hiding this comment

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

By java convention, methods that start with get() usually return a Value like a string, integer or array. For booleans you can just use isDone()


/*
* A constructor that depicts a new task.
*/

Choose a reason for hiding this comment

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

Since Task is never initiated and instead inherited by other subclasses, consider using an abstract class instead.

}

catch (IOException 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.

Very basic way of handling exceptions. Consider creating a new Exception class so you can consolidate your exceptions and have different behavior for different types of Exceptions. This method of doing things just means that when your program really does have an exception, it'll be hard to pinpoint where or how it came from because the try block is so big

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