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

[Moo Jun Wei] iP #504

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

Conversation

junweimoo
Copy link

@junweimoo junweimoo commented Aug 29, 2022

Duke

“Life is not a list of tasks but moments of experiences.”

Features

  • Add todos, events, and deadlines
  • Delete tasks
  • List all tasks
  • Search for tasks
  • Mark and unmark tasks

Downloads

Duke is FREE to download and use! (releases)

Quick Start

  1. Run the app
  2. Add a new todo: todo buy groceries
  3. List your tasks: list
  4. Mark your task as done: mark 1

Implementation

Here's the main method:

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

To be Completed

  • Better GUI 😃
  • Give Duke a personality 😎
  • More unit tests 👍

Copy link

@alvinjiang1 alvinjiang1 left a comment

Choose a reason for hiding this comment

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

Other than certain long methods and some small issues regarding coding standards, I think the code is fine. Keep up the good work! You are doing great :))

@Override
public String toDataString() {
return String.format("[D] | %d | %s | %s",
isMarked() ? 1 : 0,

Choose a reason for hiding this comment

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

Perhaps you could look into replacing the 1 and 0 in the conditional statement with a named constant? It could be considered a "magic number".

Comment on lines 41 to 44
System.out.println(
"Hello! I'm Duke\n" +
"What can I do for you?"
);

Choose a reason for hiding this comment

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

Could perhaps break up the line before the operator, in accordance with the coding standards?

loop(sc);
}

public void loop(Scanner sc) {

Choose a reason for hiding this comment

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

This method looks long and complex, could think of abstracting out key components into different methods?

import java.io.IOException;
import java.util.List;
import java.util.Scanner;

public class Duke {

Choose a reason for hiding this comment

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

It would be great if javadocs are included :))

junweimoo and others added 4 commits September 12, 2022 13:31
Previously, the parse() method is lengthy. The body is divided into two main
responsibilities - separating the input into the command keyword and the body,
and then parsing them to return a Command. Code blocks are extracted into two
private methods to improve the readability of the code and adhere to a single level\
of abstraction within parse().
Improve code quality in InputParser
junweimoo and others added 4 commits September 15, 2022 23:05
Performing consecutive undos will undo commands one-by-one in order of the
history of executed commands. Undo itself is not included in the history of executed
commands.
Comment on lines 26 to 43
switch (command) {
case "bye":
return new ExitCommand(ui);
case "list":
return new PrintTasksCommand(ui, tasks);
case "mark":
return new MarkTaskCommand(storage, ui, tasks, body);
case "unmark":
return new UnmarkTaskCommand(storage, ui, tasks, body);
case "delete":
return new DeleteTaskCommand(storage, ui, tasks, body);
case "find":
return new FindTaskCommand(tasks, ui, body);
case "todo":
return new AddTaskCommand(storage, ui, tasks, TaskType.TODO, body);
case "deadline":
return new AddTaskCommand(storage, ui, tasks, TaskType.DEADLINE, body);
case "event":

Choose a reason for hiding this comment

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

I think this change(from if to swtich) is good!

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.

3 participants