Skip to content

[T1duS] ip#680

Open
T1duS wants to merge 54 commits intonus-cs2103-AY2425S1:masterfrom
T1duS:master
Open

[T1duS] ip#680
T1duS wants to merge 54 commits intonus-cs2103-AY2425S1:masterfrom
T1duS:master

Conversation

@T1duS
Copy link
Copy Markdown

@T1duS T1duS commented Sep 8, 2024

Description

This is Duke project called Opus.
Opus is a chatbot that does the following:

  • Records Tasks
  • Tracks Deadlines
  • Gives you reminders

Features

Opus has the following features:

  1. It is friendly
  2. It is lightweight
  3. It is customizable

It is like your own personal calendar

If you are a Java programmer, you can use it to practice Java too. Here's the main method:

public class Main {
    public static void main(String[] args) {
        Application.launch(MainApp.class, args);
    }
}

👍 Hope you enjoy using Opus :shipit:

damithc and others added 14 commits July 11, 2024 16:52
In build.gradle, the dependencies on distZip and/or distTar causes
the shadowJar task to generate a second JAR file for which the
mainClass.set("seedu.duke.Duke") does not take effect.
Hence, this additional JAR file cannot be run.
For this product, there is no need to generate a second JAR file
to begin with.

Let's remove this dependency from the build.gradle to prevent the
shadowJar task from generating the extra JAR file.
Comment thread src/main/java/Opus.java Outdated
String s = scanner.nextLine();
String[] words = s.split(" ");

try{
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Perhaps use egyptian style brackets?

Comment thread src/main/java/Opus.java Outdated
Comment on lines +31 to +39
else if (words[0].equals("delete")) {
int i = Integer.parseInt(words[1]);
System.out.println("Noted. I've removed this task:");
System.out.println(" " + tasks[i]);
for (int j = i; j < taskCount; j++) {
tasks[j] = tasks[j + 1];
}
taskCount--;
System.out.println(" Now you have " + taskCount + " tasks in the list.");
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Would it be better to extract out the tasks into individual classes? Perhaps it will make the code look cleaner

Comment thread src/main/java/Opus.java Outdated
tasks[++taskCount] = new Deadline(parts[0], parts[1]);
} else if (words[0].equals("event")) {
String[] parts = s.substring(6).split(" /from ");
String[] parts2 = parts[1].split(" /to ");
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Perhaps a more intuitive variable name here?

Comment thread src/main/java/Deadline.java Outdated
@@ -1,13 +1,18 @@
public class Deadline extends Task {
protected String by;
private String by;
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Perhaps can give the deadline date a clearer name? Right now the name "by" may not be clear to other programmers.

Comment thread src/main/java/Parser.java Outdated
@@ -0,0 +1,3 @@
public class Parser{
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

This is nitpicking but don't forget the space to follow coding standards. In the future can check through.

Comment thread src/main/java/ToDo.java Outdated
@Override
public String toString() {
return "[T]" + super.toString();
return "[T]" + (isDone ? "[X] " : "[ ] ") + description;
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Perhaps you could add a method to Task class that returns a string with (isDone ? "[X] " : "[ ] "). Then you can call super.thisMethod for easier coding?

Copy link
Copy Markdown

@zacharyxzz zacharyxzz left a comment

Choose a reason for hiding this comment

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

Looks good in general.
However, there are a few coding standard violations and potential areas for improvement.

Comment thread src/main/java/Storage.java Outdated
writer.close();
}
catch (IOException e){
return;
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Perhaps logging or printing an error message could be helpful for diagnosing the exceptions here?

Comment thread src/main/java/Opus.java Outdated
taskList = new TaskList(storage.load());
}

public void run() {
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Could this method be refactored into smaller methods to handle the different scenarios more effectively?

T1duS and others added 27 commits September 14, 2024 14:36
Refactor Opus class to remove Ui dependency and add new command handlers

* The delete, mark, help, and bye command have been seperately added as command handlers.
* Javadoc comments have been added for each of these handle command functions
* The previous run method which used to execute these commands and use the UI class has been removed. Now the UI used is the JavaFX one. So, the commit also removed the UI class because it is not needed anymore.
code quality and exception changes
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.

6 participants