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

[Fong Yi Fei] iP #282

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

[Fong Yi Fei] iP #282

wants to merge 56 commits into from

Conversation

YiFei2
Copy link

@YiFei2 YiFei2 commented Jan 28, 2022

It's Bobby.

Features

  • Bobby will remember what you tell him.
  • Bobby can remind you of what you told him.
  • Bobby can search his memory for something you told him.

What can Bobby remember?

  1. To dos
  2. Deadlines (with date in YYYY-MM-DD format)
  3. Events (with date/time in any format)

Here is how Bobby would encourage you in taskDone

public static void taskDone(Task t) {
        System.out.println("Bobby applauds you. This task is done:\n" + t);
    }

An example of what you could do with Bobby.

  • CS2103 iP tab
  • CS2106 lab
  • shower 🚿
  • CS2102 tutorial

"If you got a dog, feed it everyday. But if you don't, don't."

?

damithc and others added 28 commits July 29, 2021 20:30
# Conflicts:
#	src/main/java/Deadline.java
# Conflicts:
#	src/main/java/bobby/Bobby.java
Copy link

@khoahre123 khoahre123 left a comment

Choose a reason for hiding this comment

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

Look pretty solid, some lines need to change according to the coding standard. Overall, good job 💯


@Override
public void writeToFile(FileWriter fw) throws IOException {
fw.write("E ; " + isDone + " ; " + description + " ; " + at + System.lineSeparator());

Choose a reason for hiding this comment

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

Should the break line be 8 spaces indent compared to the parent line?

import java.time.format.DateTimeFormatter;

public class Deadline extends Task {
protected LocalDate by;

Choose a reason for hiding this comment

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

Maybe another more meaningful name?

case DEADLINE:
try {
tasks.addDeadline(userInput);
} catch (BobbyException e) {

Choose a reason for hiding this comment

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

I think you can combine all the expected exceptions into one file and call that instance

String description = splitInputs[0];
LocalDate by = LocalDate.parse(splitInputs[1]);
Deadline newDeadline = new Deadline(description, by);
System.out.println("Bobby heard: " + newDeadline);

Choose a reason for hiding this comment

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

Maybe you can take all the System.out.println line into a new method in Ui class?


public class BobbyException extends Exception {
public BobbyException(String errorMessage) {
super(errorMessage);

Choose a reason for hiding this comment

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

I think you can turn this into a more customize file, instead of simply extends the Exception class


@Override
public String toString() {
return "[D]" + super.toString() + " (by: " + by.format(DateTimeFormatter.ofPattern("MMM d yyyy")) + ")";

Choose a reason for hiding this comment

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

Should the break line be 8 spaces indent compared to the parent line?

} catch (BobbyException e) {
System.out.println(e);
} catch (DateTimeParseException e) {
System.out.println("Invalid date format. Please use YYYY-MM-DD.");

Choose a reason for hiding this comment

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

I noticed the same issue in several other places too

@YiFei2 YiFei2 marked this pull request as draft February 3, 2022 17:50
YiFei2 and others added 28 commits February 7, 2022 00:58
…ye" command

Change GUI display pictures
Ensure text is displayed fully for long tasklists
To ensure assumptions and ease of debugging for future extensions

Let's insert assert statements in various points to ensure
assumptions hold and methods function as expected
…odeQuality

# Conflicts:
#	src/main/java/bobby/Parser.java
Parse() method in Parser class do not have same level of abstraction
and have common behaviors across several switch cases.

Extracting out common behaviors into private methods in the class
improves the code quality of the method as it now has single level
of abstraction and do not have common behavior across cases.

Let's extract out the splitting process into various private methods
to split the input
Undo command will help users correct their incorrect inputs easily.

Let's keep track of the state of Bobby after each change made and
implement the Undo command to reverse the most recent change.
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