Skip to content

[Luah Jun Yang} iP#571

Open
LuahJunYang wants to merge 31 commits into
nus-cs2103-AY2324S1:masterfrom
LuahJunYang:master
Open

[Luah Jun Yang} iP#571
LuahJunYang wants to merge 31 commits into
nus-cs2103-AY2324S1:masterfrom
LuahJunYang:master

Conversation

@LuahJunYang

@LuahJunYang LuahJunYang commented Sep 7, 2023

Copy link
Copy Markdown

Frenchie

"I need more boulets." -Frenchie

Frenchie keeps track of all tasks in your life in a fuss-free CLI. It is:

  • Simple to learn
  • Text-commands based
  • SUPER FAST

All you need to start using Frenchie is:

  1. Download Frenchie from here
  2. Double click the jar file
  3. Enter your tasks in the right format
  4. Let it track all of your tasks for you 👍🏻

Features:

  • Task Tracking
  • Reminders for Tasks with deadlines (coming soon!)

For those of you who code, Frenchie is written in java and you can experiment with it to add your own features!

Here is the main() method of Frenchie:

public static void main(String[] args) {
        new Frenchie("frenchie.txt").run();
    }

Comment thread src/main/java/Frenchie.java Outdated
Comment on lines +84 to +93
} else if (input.contains("delete")){
String[] parts = input.split(" ");
int index = Integer.parseInt(parts[1]) - 1;
Task target_task = frenchie.tasks.get(index);
frenchie.deleteTask(index);
System.out.println("____________________________________________________________\n" +
"Noted. I've removed this task: \n" +
target_task.toString() + "\n" +
"Now you have " + frenchie.getNumOfTasks() + " tasks in the list.\n" +
"____________________________________________________________");

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 the number of keywords increase, perhaps you might want to start looking at enums to have a collection of your keywords!

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Seconded. In addition, perhaps you may wish to divide all the logic in your main method into several other methods, as the complexity of your program increases.

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

Good use of OOP and inheritance for the subclasses of Task. You can still improve on your coding style and your use of SLAP.

Comment thread src/main/java/Frenchie.java Outdated
this.tasks = new ArrayList<>();
}

public void addTask(Task NEW_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.

The Task parameter is a variable, not a constant. So it should be in camelCase instead, i.e. newTask.

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

public void completeTask(int index) {
tasks.get(index).mark_as_completed();

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Please follow the camelCase convention for methods, i.e. markAsCompleted.

Comment thread src/main/java/Frenchie.java Outdated
Comment on lines +84 to +93
} else if (input.contains("delete")){
String[] parts = input.split(" ");
int index = Integer.parseInt(parts[1]) - 1;
Task target_task = frenchie.tasks.get(index);
frenchie.deleteTask(index);
System.out.println("____________________________________________________________\n" +
"Noted. I've removed this task: \n" +
target_task.toString() + "\n" +
"Now you have " + frenchie.getNumOfTasks() + " tasks in the list.\n" +
"____________________________________________________________");

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Seconded. In addition, perhaps you may wish to divide all the logic in your main method into several other methods, as the complexity of your program increases.

Comment thread src/main/java/Frenchie.java Outdated
+ "|____/ \\__,_|_|\\_\\___|\n";
System.out.println("Hello from\n" + logo); */
Frenchie frenchie = new Frenchie();
String skeleton = "____________________________________________________________\n" +

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

When breaking up a statement into multiple lines, the + operator should be on a new line.

Comment thread src/main/java/ToDo.java Outdated
@@ -0,0 +1,11 @@
class ToDo 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 you should add the public access modifier to your class definition?

Comment thread src/main/java/Event.java Outdated
@@ -0,0 +1,16 @@
public class Event 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.

Should leave a whitespace between your definition and the curly braces, as in
public class Event extends Task {

Comment thread src/main/java/Frenchie.java Outdated
break;
} else if (input.equals("list")) { //Checking if user is looking to list all tasks
frenchie.listTasks();
} else if (input.contains("mark")) { //Checking if user input is to mark/unmark tasks

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

This doesn't check if the input is either mark or unmark. If a user inputs markzzzzzz, this will still be treated as unmark even though it is an invalid command, because the input still contains the substring mark. To avoid similar problems like this, perhaps you should use Java Enums to ensure input validity.

LocalDateTime storedEndTime = LocalDateTime.parse(endTime, inputFormatter);
DateTimeFormatter desiredFormatter = DateTimeFormatter.ofPattern("dd/MM/yyyy HH:mm");
String constructorStartTime = storedStartTime.format(desiredFormatter);
String constructorEndTime = storedEndTime.format(desiredFormatter);

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 think this part of your code and be improved? Maybe try to use some other methods?😊

LuahJunYang and others added 9 commits September 21, 2023 10:50
…rnMatchTasks() method to TaskList.java. Level-9 Completed.
Removed unused methods and corrected the order of import statements to be in the correct lexographical order. Fixed the error of tasks not loading from frenchie.txt by calling storage.load() before parsing the input String.
Added help as an enum in Command and included 'help' as a case for the Parser class. Added a quick start guide that will be presented to the user when user inputs 'help' as the command.
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