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

[Cheah Yan (Xie Yan)] iP #486

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

Conversation

CheahYan
Copy link

@CheahYan CheahYan commented Aug 27, 2021

DukeLite

"Your mind is for having ideas, not holding them." -David Allen (source)

DukeLite 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 class Main {
    public static void main(String[] args) {
        Application.launch(MainApp.class, args);
    }
}

Copy link

@darrenhoon darrenhoon left a comment

Choose a reason for hiding this comment

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

Overall, the use of good naming conventions and meaningful variable names shows that you placed a lot of thought into how your files can be easily understood by others. Having comment headers would greatly enhance your work.

Overall, LGTM!

import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;

public class Deadline extends Task {

Choose a reason for hiding this comment

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

Perhaps a class should have a header comment to inform users about what the class does. Same suggestion for the other .java files


protected LocalDateTime date;

public Deadline(String description, String date) {

Choose a reason for hiding this comment

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

Perhaps a method could have a header comment to inform users about what the method does.

Same suggestion for the other methods both in this file and other .java files

@@ -0,0 +1,15 @@
package duke;

public class DukeException extends Exception {

Choose a reason for hiding this comment

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

Great work using inheritance! LGTM!

this.isDone = false;
}

public String convertToFile() {

Choose a reason for hiding this comment

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

Great use of naming conventions!

protected static final String LOCAL_FILE = "data/duke.txt";

public static void appendToFile(String filePath, String textToAppend) throws IOException {
FileWriter fw = new FileWriter(filePath, true); // create a FileWriter in append mode

Choose a reason for hiding this comment

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

leaving comments to help readers enables a better understanding of your code and might even help to hasten the onboarding process. Good job!

Copy link

@g4ryy g4ryy left a comment

Choose a reason for hiding this comment

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

Overall, your code is structured logically which makes it easy to follow. I think the main issue to fix would the naming of a few variables and methods where it can be misleading or difficult to understand. Also, it would be great to include Javadoc comments which I believe would improve your code's readability. I hope my reviews will be useful to you! 🙂

public Deadline(String description, String date) {
super(description);

DateTimeFormatter scanned = DateTimeFormatter.ofPattern("dd/MM/yyyy HHmm");
Copy link

Choose a reason for hiding this comment

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

Perhaps a more meaningful name for this variable would be datePattern or dateFormat.

Comment on lines 35 to 36
String a = sc.nextLine();
String[] b = a.split(" ", 2);
Copy link

Choose a reason for hiding this comment

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

Perhaps it would be good if you could avoid using single letters to name variables unless they are iterator variables. I noticed this issue in other parts too.


} else if (details[0].equals("delete")) {
int taskIndex = Integer.valueOf(details[1]);
Task removed = history.get(taskIndex - 1);
Copy link

Choose a reason for hiding this comment

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

Perhaps a more meaningful name would be removedTask to indicate that this is the task that had been removed.

this.isDone = false;
}

public String convertToFile() {
Copy link

Choose a reason for hiding this comment

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

Perhaps a more suitable name is getDescription. I feel that naming it convertToFile can be misleading since this method does not handle any conversion.

sc.close();

}
}
Copy link

Choose a reason for hiding this comment

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

Perhaps you could apply more OOP by extracting out closely related code as classes, rather than letting the Main method handle everything.

Copy link

@houtenteo houtenteo left a comment

Choose a reason for hiding this comment

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

Great work overall :)

System.out.println("Bye! Hope to see you again soon!");
}

public void list(TaskList tasklist) {

Choose a reason for hiding this comment

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

I believe the coding standards suggest that method names should be verbs. In this case, 'list' could be a noun. Maybe a better option would be to name the method 'listAll'.

return (isDone ? "X" : " ");
}

public void Done() {

Choose a reason for hiding this comment

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

Method names should be in camel case.

return this.twoPart;
}

public boolean isBye() {

Choose a reason for hiding this comment

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

I guess u can shorten this into one-liner by just returning 'this.command.equals("bye"')'. Helps improve readability somewhat but I guess I'm just nitpicking here.

return this.twoPart[0];
}

public int secondPartInInt() throws DukeException {

Choose a reason for hiding this comment

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

Method names should be verbs. So this would be better named as 'getSecondPartInInt'.

CheahYan and others added 30 commits September 15, 2021 02:54
Program does not have Assertions

Assertions help to indicate a possible bug in the code at runtime.

Adding assertions will allow us to more easily identify mistakes that we programmers make in the code.
GUI does not display the full TaskList if there is a large number of tasks.

Users will not be able to properly view the entire list of tasks easily

DialogBox.fxml file changed allows us to easily view all the tasks in the list when "list" command is called.
Current code is not very readable for other programmers.

This can be very hard for programmers to improve upon the code in the future.

Readability of code is improved with current commit
Improve Code Quality to all files
Added Reminder feature to Duke.
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