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

[Mark Biju George] iP #306

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

Conversation

markbiju
Copy link

@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

@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!! 👍

+ "|____/ \\__,_|_|\\_\\___|\n";
System.out.println("Hello from\n" + logo);
public static void main(String[] args) throws DukeException {
Scanner myObj = new Scanner(System.in);

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?

int counter = 0;
ArrayList<Task> tasks = new ArrayList<Task>();

System.out.println("Hello! I'm Duke");

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?

if (input.equals("bye")) {
System.out.println("Bye. Hope to see you again soon!");
break;
} else if (input.equals("list")){

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.

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

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.

System.out.println("Hello from\n" + logo);
public static void main(String[] args) throws DukeException {
Scanner myObj = new Scanner(System.in);
int counter = 0;

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".

} catch (StringIndexOutOfBoundsException e) {
throw new DukeException("☹ OOPS!!! Please tell me which task to mark as done!");
}

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.

this.isDone = false;
}

public String getStatusIcon() {

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. 😅

}

@Override
public String toString() {

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.


public Deadline(String description, String by) {
super(description);
this.by = by;

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'.

}
} catch(ArrayIndexOutOfBoundsException e) {
throw new DukeException("☹ OOPS!!! Please provide a timing for your event.");
}

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?

f.createNewFile();
}

while (true) {
Copy link

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.

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

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.

f.createNewFile();
}

while (true) {
Copy link

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