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

[Ryan-Reno] iP #532

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

Conversation

Ryan-Reno
Copy link

@Ryan-Reno Ryan-Reno commented Feb 13, 2024

LITE

Lite is the next generation's ToDo List! It's :

  • text-based
  • EASY SUPER EASY to learn and use

All you need to do is,

  1. download it from here.
  2. double-click it.
  3. add your tasks.
  4. let it keep track of all the tasks for you 😃

And it is COMPLETELY FREE!

Features :

  • Managing tasks
  • Managing deadlines
  • Reminders (coming soon)

If you are a Java programmer, you can use it to practice Java too. Here's the main method:

public static void main(String[] args) {
        Chatbot chatbot = new Chatbot();
        chatbot.start();
 }

damithc and others added 12 commits January 7, 2024 18:33
Copy link

@AjayArvind2207 AjayArvind2207 left a comment

Choose a reason for hiding this comment

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

Code looks good and well written. I did feel as though you could have abstracted a bit more in terms of classes -- using smaller classes to encapsulate behaviour you have used in Chatbot.java.

}

if (instruction[0].equals("delete")) {
this.delete(instruction);

Choose a reason for hiding this comment

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

Consider removing the 'this' reference since there is inconsistent styling with addToDo among other instructions

Suggested change
this.delete(instruction);
delete(instruction);

public class Chatbot {
private Scanner scanner = new Scanner(System.in);
private String currentInput;
private ArrayList<Task> list;

Choose a reason for hiding this comment

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

Suggestion: Why not have a Tasks class to encapsulate the ArrayList objects? That way it makes the code in Chatbot.java a lot less dense, and you can abstract away most of the complexity into that class.

Copy link
Author

Choose a reason for hiding this comment

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

Sorry I don't quite get what you mean. Isn't the point of the Task class to encapsulate the ArrayList objects? If so, doesn't my Task class behave the same with the Tasks class you suggested?

@@ -0,0 +1,15 @@
public class Lite {
public static void main(String[] args) {
String logo = " LLLLL IIIIIIIII TTTTTTTTTT EEEEEEEEEE \n" +

Choose a reason for hiding this comment

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

This is super cool and I really enjoy it :D

Copy link

@jovantanyk jovantanyk left a comment

Choose a reason for hiding this comment

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

Overall Good attempt but method names could use more consistent naming. UI class is currently handling too many functions and could be split up more. Exception handling is a bit weird as it doesn't actually catch any exceptions. LiteException class should extend Exception so you can actually use try catch blocks to handle exceptions.

Choose a reason for hiding this comment

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

Method Names could be clearer. parse() could be renamed into executeCommand() instead.
Methods like find, delete, mark addDeadline, addEvent could be renamed into findTask, deleteTask, markTaskAsDone, addDeadlineTask, addEventTask for more clarity.
Overall not a bad attempt however more OOP could be used. The Ui class is currently parsing input strings, processing business logic, and handling output all at the same time. You could separate the command parsing into a different class and allow the Ui class to solely handle text generation

Choose a reason for hiding this comment

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

Method names seem inconsistent. toDoException could be renamed to printToDoException. successfulFind and unsuccessfulFind could be renamed to printFound() and printNotFound(). Since the Printer class solely handles output, methods should have consistent naming.
Also, it seems redundant to have methods to print Exceptions here when you're also handling exceptions in LiteExceptions.

Copy link
Author

Choose a reason for hiding this comment

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

Thanks for this feedback! Was not thinking properly when creating the methods and simply put it within the Printer class.

} else {
LiteException.invalidInput();
}
return false;
}

private void find (String instruction[], TaskList tasks) {

Choose a reason for hiding this comment

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

method name could be clearer for example findTask() instead of just find()

/**
* Outputs the string representation of the TaskList
*/
public void taskString() {

Choose a reason for hiding this comment

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

toString() would be better and follow naming conventions

Ryan-Reno and others added 14 commits February 14, 2024 22:08
There are several methods in Ui where tasks will be added and deleted.
As a result, the size of the tasklist will go up and down accordingly.

The usage of assert will ensure that the size of these will adjust
according to what task has been presented, whether it is a delete or
add.
The parsing method within Ui is put into its own class called Parser.
Its task is to receive the input and determine which task the input is
associated with
Added a constraint that does not allow tasks that has been added to be
added again into the Task List. Tasks with different types (Event, Todo,
and Deadline) with the same description will be considered a different
task.

Two deadline tasks will also be considered different if their deadlines
do not end at the same time.
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