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

[Saketh] iP #484

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

Conversation

loose-bus-change
Copy link

@loose-bus-change loose-bus-change commented Aug 27, 2021

Duke

Your own personal task recording system

“Your mind is for having ideas, not holding them.” – David Allen

DukePro frees your mind of having to remember things you need to do. It's,

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

In order to access it:

  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)

This is a sample task list that you can view if you type the list command:
[D][ ] return book by: 2019-12-02
[E][ ] meeting at: 2015-10-15
[E][X] project meeting at: 2015-10-15

Here is the main method of the application:

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

Copy link

@gordonlzy gordonlzy left a comment

Choose a reason for hiding this comment

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

LGTM, just a few nitpicks

s.appendListToFile(t);
} else if (input.startsWith("find")) {
String keyword = input.substring(5);
ArrayList<Task> output = new ArrayList<>();

Choose a reason for hiding this comment

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

Perhaps the usage of plural form for output will work better?

Copy link

Choose a reason for hiding this comment

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

I think the variable name should be completely renamed. The queried tasks aren't an "output"; they are the result of a query, and are then reformatted into a text result that gets printed.

private Storage storage;
private TaskList tasks;
private File
file;

Choose a reason for hiding this comment

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

Any reason why you put file on the next line?

@@ -1,10 +1,53 @@
import duke.*;

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 list all the imported classes?

Choose a reason for hiding this comment

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

I concur with @gordonlzy. I think this violates one of the coding standards.

Copy link

Choose a reason for hiding this comment

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

I agree as well. Imports should be one at a time.

* @param s The Storage that handles the reading and writing to a text file
* @param file The file that gets written to and read from
*
* @return void

Choose a reason for hiding this comment

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

Is it necessary to add @return for void?

Copy link

@wilburrito wilburrito left a comment

Choose a reason for hiding this comment

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

LGTM, but just a few nits to fix, that's all.

@@ -1,10 +1,53 @@
import duke.*;

Choose a reason for hiding this comment

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

I concur with @gordonlzy. I think this violates one of the coding standards.

* Method that adds a Deadline task onto TaskList
*
* @param input The string that contains the user input
* @param t The TaskList that contains the tasks to be added

Choose a reason for hiding this comment

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

perhaps the naming of some of the parameters could be more verbose; however this is just nitpicky, since your javadocs already explain what the parameters mean. Good work! 👍🏻

* @param date The date mentioned in the task initialization.
*
*
* @return void

Choose a reason for hiding this comment

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

I'm not sure if this is necessary for a void method.

Copy link

@JasonC01 JasonC01 left a comment

Choose a reason for hiding this comment

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

LGTM:)!! Great work overall!

import java.time.format.DateTimeFormatter;

public class Deadline extends Task {
protected LocalDate by;
Copy link

Choose a reason for hiding this comment

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

In my opinion, deadline seems to be a better name compared to by

Copy link

@Smanmos Smanmos left a comment

Choose a reason for hiding this comment

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

Quite good overall, but many parts could be improved

class NullTaskError extends DukeException {
public NullTaskError() {
super("OOPS!!! The description of a todo cannot be empty.");
}
Copy link

Choose a reason for hiding this comment

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

I think it would be better for type to be in the constructor instead of the getMsg method.

@@ -1,10 +1,53 @@
import duke.*;
Copy link

Choose a reason for hiding this comment

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

I agree as well. Imports should be one at a time.

private TaskList tasks;
private File
file;
private Parser p;
Copy link

Choose a reason for hiding this comment

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

Avoid one letter names; parser would be a better name

Comment on lines 53 to 61
String year = breakingDate[2];
String month = breakingDate[1];
String currentDate = breakingDate[0];
int i = Integer.parseInt(currentDate);
if (i < 10) {
currentDate = "0" + currentDate;
}
String finalDateFormat = year + "-" + month + "-" + currentDate;
LocalDate date1 = LocalDate.parse(finalDateFormat);
Copy link

Choose a reason for hiding this comment

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

Can be simplified using method LocalDate.of


public class Ui {
Scanner scan;
private String str;
Copy link

Choose a reason for hiding this comment

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

Could be more descriptive; what String is str holding?

The reading from file method does not check whether the current task is done or not

This needs to change so that the done nature of the task can be viewed by user

The method of string manipulation has been updated to
include this change

Now every time the user asks for the list, the tasks that are marked done will
be reflected as such in the output
Added assertions to the code

This ensures that there are no unexpected errors in the code
during running

It is being fixed by adding relevant asserts statements
in methods where applicable
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.

5 participants