Skip to content

[Cheah Yan (Xie Yan)] iP#486

Open
CheahYan wants to merge 64 commits into
nus-cs2103-AY2122S1:masterfrom
CheahYan:master
Open

[Cheah Yan (Xie Yan)] iP#486
CheahYan wants to merge 64 commits into
nus-cs2103-AY2122S1:masterfrom
CheahYan:master

Conversation

@CheahYan

@CheahYan CheahYan commented Aug 27, 2021

Copy link
Copy Markdown

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);
    }
}

@darrenhoon darrenhoon left a comment

Copy link
Copy Markdown

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 {

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 a class should have a header comment to inform users about what the class does. Same suggestion for the other .java files

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

protected LocalDateTime date;

public Deadline(String description, String date) {

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 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 {

Copy link
Copy Markdown

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!

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

public String convertToFile() {

Copy link
Copy Markdown

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!

Comment thread src/main/java/duke/Duke.java Outdated
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

Copy link
Copy Markdown

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!

@g4ryy g4ryy left a comment

Copy link
Copy Markdown

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! 🙂

Comment thread src/main/java/duke/Deadline.java Outdated
public Deadline(String description, String date) {
super(description);

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

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 a more meaningful name for this variable would be datePattern or dateFormat.

Comment thread src/main/java/duke/Duke.java Outdated
Comment on lines +35 to +36
String a = sc.nextLine();
String[] b = a.split(" ", 2);

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

Comment thread src/main/java/duke/Duke.java Outdated

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

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 a more meaningful name would be removedTask to indicate that this is the task that had been removed.

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

public String convertToFile() {

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 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
Copy Markdown

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.

@houtenteo houtenteo left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Great work overall :)

Comment thread src/main/java/duke/Ui.java Outdated
System.out.println("Bye! Hope to see you again soon!");
}

public void list(TaskList tasklist) {

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

Comment thread src/main/java/duke/Task.java Outdated
return (isDone ? "X" : " ");
}

public void 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.

Method names should be in camel case.

Comment thread src/main/java/duke/Parser.java Outdated
return this.twoPart;
}

public boolean isBye() {

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

Comment thread src/main/java/duke/Parser.java Outdated
return this.twoPart[0];
}

public int secondPartInInt() throws DukeException {

Copy link
Copy Markdown

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