Skip to content

[Mark Biju George] iP#306

Open
markbiju wants to merge 57 commits into
nus-cs2103-AY2122S2:masterfrom
markbiju:master
Open

[Mark Biju George] iP#306
markbiju wants to merge 57 commits into
nus-cs2103-AY2122S2:masterfrom
markbiju:master

Conversation

@markbiju
Copy link
Copy Markdown

@markbiju markbiju commented Jan 30, 2022

DukePro

"The best time to plant a tree was 20 years ago. The second best time is now.” - Chinese Proverb (source)

DukePro 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. open a command line prompt
  3. cd to where the downloaded file is(e.g cd \User\John\Desktop)
  4. type this command: java -jar main.jar
  5. add your tasks.
  6. let it manage your tasks for you 😏

And it is FREE!

Features

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

Here's a sneak peek into what's going on behind the scenes😏

public static void main(String[] args) {
        new Duke("data/tasks.txt").run();
    }

@markbiju markbiju changed the title [Mark Biju George] [Mark Biju George] iP Jan 30, 2022
Copy link
Copy Markdown

@LowJiaHao99 LowJiaHao99 left a comment

Choose a reason for hiding this comment

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

Overall, this is a pretty good effort in following Java Coding Standards closely. The code is pretty clean and simple and it helps to improve readability. Some names of the variable can be improved to further enhance it. There are also some inconsistency, that needs addressing, in regards to the way you organize your code.

Other than that, good job!! 👍

Comment thread src/main/java/Duke.java Outdated
+ "|____/ \\__,_|_|\\_\\___|\n";
System.out.println("Hello from\n" + logo);
public static void main(String[] args) throws DukeException {
Scanner myObj = new Scanner(System.in);
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 "scanner" be a better variable name here?

Comment thread src/main/java/Duke.java Outdated
int counter = 0;
ArrayList<Task> tasks = new ArrayList<Task>();

System.out.println("Hello! I'm Duke");
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 you consider creating a constant final String for these messages to be printed?

Comment thread src/main/java/Duke.java Outdated
if (input.equals("bye")) {
System.out.println("Bye. Hope to see you again soon!");
break;
} else if (input.equals("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.

As per java Coding Standards

Java reserved words should be followed by a white space.

Perhaps you can add a white space between the condition and the open parenthesis to be consistent with the rest of the code.

I notice many similar issues throughout the rest of the code.

Comment thread src/main/java/Duke.java Outdated
System.out.println(currentTask);
} catch (StringIndexOutOfBoundsException e) {
throw new DukeException("☹ OOPS!!! Please tell me which task you want me to mark as not done!");

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 this might be a mistake, do remember to leave out empty lines within a logic block.

I see such mistake appearing occasionally in the rest of the code.

Comment thread src/main/java/Duke.java Outdated
System.out.println("Hello from\n" + logo);
public static void main(String[] args) throws DukeException {
Scanner myObj = new Scanner(System.in);
int counter = 0;
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

How about a more intuitive name here? Suggestion: "numOfTasksInList".

Comment thread src/main/java/Duke.java Outdated
} catch (StringIndexOutOfBoundsException e) {
throw new DukeException("☹ OOPS!!! Please tell me which task to mark as done!");
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Are the empty lines used to differentiate between the next condition in the user input processing? This is a pretty good style as it notifies readers/reviewers of the change in logic.

Comment thread src/main/java/Task.java Outdated
this.isDone = false;
}

public String getStatusIcon() {
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

I like the way you name this method. It is short, direct and natural.

Much better than getIsDone() which is what I named mine. 😅

Comment thread src/main/java/Deadline.java Outdated
}

@Override
public String toString() {
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

I like the use of toString() to print details of the task. The method name itself is already specific to its action and it is a built-in method in all java objects.

Comment thread src/main/java/Deadline.java Outdated

public Deadline(String description, String by) {
super(description);
this.by = 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 this variable name can be more specific? One might mistake 'by' as 'added by' instead of 'complete by'.

Comment thread src/main/java/Duke.java Outdated
}
} catch(ArrayIndexOutOfBoundsException e) {
throw new DukeException("☹ OOPS!!! Please provide a timing for your event.");
}
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 this might have been missed during checks, did you made a mistake and left out a empty white line to separate the if-else logic blocks?

Comment thread src/main/java/Duke.java Outdated
f.createNewFile();
}

while (true) {
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, parsing user inputs could be done in another class called Parser for more abstraction and OOP.

Comment thread src/main/java/Duke.java Outdated
int toBeMarked = Integer.parseInt(input.substring(5));
Task currentTask = tasks.get(toBeMarked - 1);
currentTask.markAsDone();
System.out.println("Nice! I've marked this task as done:");
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, printing of messages could be done in another Ui class for better abstraction and OOP.

Comment thread src/main/java/Duke.java Outdated
f.createNewFile();
}

while (true) {
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, this code block is too long, could work towards better abstraction overall.

markbiju16 and others added 30 commits February 19, 2022 15:31
Parsing and storage may occur differently if there are more spaces/unexpected input

Assertions are needed to test whether parsing and storage is working properly

Add assertions in parts of storage and parser code to enforce testing.

Let's observe the results of these assertions using different inputs
Some lines are too long.

They need to be shortened to improve readability.

Line breaks are placed such that longer lines of code are broken down into shorter segments
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.

4 participants