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

[NBQian] iP #312

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

[NBQian] iP #312

wants to merge 74 commits into from

Conversation

NBQian
Copy link

@NBQian NBQian commented Jan 27, 2023

DUKE

"Your mind is for having ideas, not holding them." - David Allen

Duke helps you organise different types of tasks to keep you on track. Tasks include:

  • Todo: no deadline, finish anytime
  • Deadline: a task with a deadline
  • Event: a task that has a starting time and an ending time

Duke has the following functions:

  1. list: list down all your tasks
  2. mark: mark a task as done
  3. unmark: mark a task as undone
  4. find: find all tasks that contains a key phrase
  5. create: adding tasks to your plan
  6. delete: remove tasks from your plan

you can check the source code here

for java programmers, want to know how the code that runs the program, run looks like 😃? Here you are:

    public void run() {
        ui.welcome();
        boolean isExit = false;
        while (!isExit) {
            try {
                String inputLine = ui.readCommand();
                Command c = Parser.parse(inputLine);
                c.execute(tasks, ui, storage);
                isExit = c.isExit();
            } catch (DukeException e) {
                System.out.println(e.getMessage());
            }
        }
    }

Features:

  • Managing tasks

  • Managing deadlines

  • Reminders (coming soon)

And it is FREE!

damithc and others added 30 commits July 31, 2022 17:20
tasks input by the user can only be saved while Duke is running and will be gone once Duke stops running

Create a data folder with a task.txt file in it to permanently store all tasks

Additionally:
1. changed line break style
2. added different greeting messages depending on the existence of data folder and/or tasks.txt file
this means locally saved tasks are not constantly updated whenever the list changes

modified Main method such that changes are immediately reflected locally
this is not very flexible in terms of manipulating the way in which date and time is printed.

Change Task subclasses such that they store date and time as java.time.LocalDateTime
* branch-Level-8:
  Task subclasses store time as a String

# Conflicts:
#	src/main/java/Duke.java
* commit '556af3f47a96b32898ab4cdbd65b16486a4871e8':
  Add Gradle support
This reverts commit 6b07de7.
Copy link

@panpannnnn panpannnnn left a comment

Choose a reason for hiding this comment

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

Well organised, sorry I don't really understand the extra things you did so no comment on those.

try {
storage.update(tasks);
} catch (IOException e) {
System.out.println("failed to update tasks locally: " + e.getMessage());

Choose a reason for hiding this comment

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

Line break for better readability, happens in other files as well

/**
* a list of valid Commands as enum
*/
public enum CommandType {

Choose a reason for hiding this comment

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

Good use of enums

package duke.dukeexception;

/**
* class that handles exceptions unique to the Duke application

Choose a reason for hiding this comment

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

Capitalise first letters to be more formal

try {
tasks.get(taskNumber - 1).mark();
} catch (Exception e) {
throw new DukeException(

Choose a reason for hiding this comment

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

More layman exception message would be nice

Copy link

@amoonguss1 amoonguss1 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 structure of the code is clean and readable. Just a few nitpicks few javadocs and capitalizations.

*/
public class ByeCommand extends Command {
/**
* determines that user wants to exit the program

Choose a reason for hiding this comment

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

Shouldn't the first letter of the description be in caps?

Suggested change
* determines that user wants to exit the program
* Determines that user wants to exit the program

}

/**
* on execution, prints goodbye message

Choose a reason for hiding this comment

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

Same goes for this and some other methods in other classes,

Suggested change
* on execution, prints goodbye message
* On execution, prints goodbye message

Comment on lines 35 to 40
/**
* a method that loads the local tasks into the TaskList if they exist. prints customised
* messages if the file and/or folder does not exist, and create them accordingly
* @return an empty ArrayList of Tasks if no local tasks are found, or an ArrayList
* containing all local tasks if they are found.
*/

Choose a reason for hiding this comment

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

You might want to add a @throws comment in this jdoc,

Suggested change
/**
* a method that loads the local tasks into the TaskList if they exist. prints customised
* messages if the file and/or folder does not exist, and create them accordingly
* @return an empty ArrayList of Tasks if no local tasks are found, or an ArrayList
* containing all local tasks if they are found.
*/
/**
* a method that loads the local tasks into the TaskList if they exist. prints customised
* messages if the file and/or folder does not exist, and create them accordingly
* @return an empty ArrayList of Tasks if no local tasks are found, or an ArrayList
* containing all local tasks if they are found.
* @throws ...
*/

}

/**
* @return all the tasks row by row

Choose a reason for hiding this comment

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

might want to give a brief description of this method.

Niu BoQian and others added 28 commits February 3, 2023 18:57
…o have assertion to check if the output messages are correct

The lack of assertion can leave inaccurate output messages unchecked

Adding assertion can ensure that the output messages are accurate

Let's java assertion to each class with unique error message should the assertion fail. For example, if the output message of FindCommand is inaccurate, a message "wrong find message" will be output.

Additionally, a get() method is added to TaskList class to facilitate addition of assertion to the above classes.
there are redundant code that is no longer useful. For example, the Status attribute and some output messages

the name of the method "update" is not meaningful enough.

readers of the code might get confused when reading the code

removing the unused attribute and output messages increases the readability of the code

Let's remove the redundant lines and refactor the method "update" to "updateLocal"

Class Duke

method "getLoadStatus" is no longer used because the Status attribute in Storage is removed

removing this method prevents error from occurring

Let's remove the unused method getLoadStatus()
…ommand, FindCommand, MarkCommand, ListCommand, CommandType, DukeException, Parser, Storage, Deadline, Event, Task, Todo, TaskList, Ui.

Header comments are not in accordance with the format specified in the coding standard.

Comments in the wrong format makes it harder for the readers to understand various methods

Let's change the problematic comments in accordance with the format specified in the coding standard

Additionally, unused method "readCommand" in Ui class is removed.
…mand

"==" is used to compare Strings in the java assertions

This may result in the assertion returning false even when the Strings look the same

This can complicate the debugging process when an assertions gives an error

Let's  replace "==" with the .equals() method in java assertions for Strings.
…o branches merged, so I'm adding back that method.
Somehow the get method in TaskList magically disappeared after the tw…
…anged font for text at the input window. Updated welcome message
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