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

[Nevin Lim] iP #270

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

[Nevin Lim] iP #270

wants to merge 46 commits into from

Conversation

nevinlim
Copy link

@nevinlim nevinlim commented Jan 26, 2023

Duke bot

Simplicity is the soul of efficiency. -Austin Freeman [ source]

Duke frees your mind of having to remember things you need to do. It's:

  • text-based
  • easy to learn
  • FAST SUPER FAST to use

All you need to do is,

  1. download it from here.
  2. double-click it.
  3. add your tasks.
  4. let it manage your tasks for you 😉

And it is FREE❗ ❗ 😃

Features:

  • Managing tasks
  • Managing deadlines (coming soon)
  • Reminders (coming soon)

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

public static void main(String[] args) {
        System.out.println("Hello! I'm Duke");
    }

@@ -0,0 +1,14 @@
public class Deadline extends Task {

protected String by;
Copy link

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 use private modifier here? Or is there a particular reason to use protected?

System.out.println("____________________________________________________________\n" +
"Nice! I've marked this task as done:\n" +
" " + tasks.get(num - 1).toString() + "\n" +
"____________________________________________________________");
Copy link

Choose a reason for hiding this comment

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

I think you could make the line breaks private fields so that you don't need to type so many times

public class Duke {
private static final String greeting = "____________________________________________________________\n" + "Hello! I'm Duke\n" + "What can I do for you?\n" + "____________________________________________________________";
Copy link

Choose a reason for hiding this comment

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

I think for static final fields, the variable name should all be in uppercase:)

public class Duke {
private static final String greeting = "____________________________________________________________\n" + "Hello! I'm Duke\n" + "What can I do for you?\n" + "____________________________________________________________";
private static final String goodbye = "____________________________________________________________\n" + "Bye. Hope to see you again soon!\n" + "____________________________________________________________";
private static boolean active = true;
Copy link

Choose a reason for hiding this comment

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

perhaps rename to isActive to make the variable sound more boolean?

@@ -0,0 +1,7 @@
import java.util.*;
Copy link

Choose a reason for hiding this comment

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

Maybe specify the class being imported instead of just importing *


import java.io.IOException;

public class MarkCommand extends Command {

Choose a reason for hiding this comment

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

need javadoc


import java.io.IOException;

public class MarkCommand extends Command {

Choose a reason for hiding this comment

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

I don't think it makes sense to have these as classes. methods make more sense

}

public void execute(Tasklist tasklist, Ui ui, Storage storage) throws IOException {
tasklist.markDone(this.taskNum - 1);

Choose a reason for hiding this comment

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

tasklist -> taskList

import duke.command.*;
import duke.task.Deadline;
import duke.task.Event;
import duke.task.Todo;

Choose a reason for hiding this comment

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

should split the imports

* @throws DukeException when input is invalid
*/
public static Command parseCommand(String fullCommand) throws DukeException {
String[] splits = fullCommand.split(" ", 2 );

Choose a reason for hiding this comment

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

not a very indicative name for this array

throw new DukeException("☹ OOPS!!! Please use format: event <description> /from <datetime> /to <datetime>");
}
try {
String[] secondsplits = splits[1].split("/from", 2);

Choose a reason for hiding this comment

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

variable naming standards

StringBuilder strings = new StringBuilder();
FileWriter fw = new FileWriter(this.file);

for (Task curr : tasklist.getTasks()) {

Choose a reason for hiding this comment

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

this is a complicated expression. Can be simplified

.append(curr.getDescription())
.append("\n");
} else if (curr instanceof Deadline) {
strings.append("D ")

Choose a reason for hiding this comment

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

not very readable

printLine();
}

public void printFoundTasks(ArrayList<Task> foundTasks) throws DukeException {

Choose a reason for hiding this comment

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

missing javadoc

import duke.main.Ui;

public class ExitCommand extends Command {
public void execute(Tasklist taskList, Ui ui, Storage storage) {

Choose a reason for hiding this comment

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

nota very indicative name for the method

nevinlim and others added 18 commits February 15, 2023 11:00
# Conflicts:
#	src/main/java/duke/command/AddCommand.java
Removed duplicated getTasksNum() method from Tasklist and did some cosmetic changes to several other classes.
Added the ability to recognize and deal with duplicate tasks from user.
Added *personality* to newly named Smudge program. Added new help command too
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