Skip to content

[Aakansha Narain] iP#491

Draft
aakanshanarain wants to merge 57 commits into
nus-cs2103-AY2122S1:masterfrom
aakanshanarain:master
Draft

[Aakansha Narain] iP#491
aakanshanarain wants to merge 57 commits into
nus-cs2103-AY2122S1:masterfrom
aakanshanarain:master

Conversation

@aakanshanarain

@aakanshanarain aakanshanarain commented Aug 28, 2021

Copy link
Copy Markdown

Duke: Your personal task manager

Welcome to Duke! Duke provides an interface to keep track of your tasks to make sure you never fall back on work! Here's some stuff you can do with Duke:

  • Store todo, event and deadline tasks
  • Add date and time to your event and deadline tasks
  • Tag your tasks to group tasks together

To use Duke, all you have to do is:

  1. Download the program from here
  2. Double click it
  3. Add your tasks
  4. Let it do the rest for you!

An example from our previous users:

  • Finish CSXXXX Assignment (by: Sep 20 2021, 11:59pm)
  • Meet friends (at: Sep 21 2021, 3:00pm)
  • Buy groceries
  • Attend book club meeting (at: Sep 25, 5:00pm) #bookClub
  • Write book report #bookClub

Take a look at some reviews from current users:

Duke has helped me manage my tasks so much more efficiently! It really is a second brain!

Ever since I started using Duke, I've never missed a deadline! It really helps me through the stressful university semester!

For more users experienced in programming, play around with the software to make it more customisable! Here's the main method to get you started:

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

Get started with Duke now! 🤩

@aakanshanarain aakanshanarain changed the title README.md [Aakansha Narain] iP Aug 28, 2021

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

LGTM!!
Overall, your code is nice and well organized.
Just added some comment and possible improvements to make.

Comment thread src/main/java/duke/EventInput.java Outdated
Comment on lines +16 to +17
int charIndex = input.indexOf("/" );
int atIndex = charIndex + 4;

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 like how you named your variables here! (Easy to understand)


public void add (Task task) {
todoList.add(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.

I like how you named your variables with verbs, easy to understand at one glance.

public class Event extends Task {

private String at;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

You could remove the extra empty line

Comment thread src/main/java/duke/InputHandler.java Outdated
Comment on lines +3 to +5
public abstract class InputHandler {
protected Ui ui;
protected 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.

You could add a line between? (To keep your coding style consistent, same thing with couple of other files)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Hey Aakansha!

Overall, really liked the organisation of your project. It really adheres to the principles of OO! I'll be leaving some comments on some parts of your project. Once again, well done!

Comment thread src/main/java/Duke.java Outdated
@@ -1,10 +1,64 @@
//Solution below slightly adapted from https://github.com/Wincenttjoi/CS2103T-duke-chatbot/blob/master/src/main/java/duke/Duke.java

import duke.*;

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 you be including the individual packages here rather than a wildcard?

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

private Ui ui;
private TaskList taskList;
private boolean exit;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

You could change this to a more boolean sounding name!

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

public enum InputCommands {
bye, list, done, delete, todo, deadline, event

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Since these are going to be unchanged, you could possibly rename to be capitalised? For example, BYE, LIST, DONE etc. However, i like the naming of the enum InputCommands here!

Comment thread src/main/java/Duke.java

import duke.*;

public class Duke {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

You could also add some comments here! I think this would allow you to communicate your code effectively!

Comment thread src/main/java/Duke.java Outdated
bye, list, done, delete, todo, deadline, event
}

public void start () {

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 you do not need to add a space after the method name here! just start() would do

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

@Override
public String handle(String input) throws EmptyDescriptionException {
if (input.length() == 6) {

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'm not too sure whether i understand the reasoning behind using length() here. Could you comment on this?

Comment thread src/main/java/duke/DoneInput.java Outdated
@Override
public String handle (String input) throws EmptyDescriptionException {
if (input.length() == 4) {
throw new EmptyDescriptionException("error");

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 it's great to have different Exceptions here! really improves the OO-ness of the project.

Comment thread src/main/java/duke/DoneInput.java Outdated
throw new EmptyDescriptionException("error");
}

char taskIndex = input.charAt(5);

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 you could rename the variable here, to something like indexOfTask?

Comment thread src/main/java/duke/TaskList.java Outdated
import java.util.ArrayList;

public class TaskList {
private static ArrayList<Task> todoList;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

You could rename this to tasks to keep it consistent with the coding standards provided by prof!

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 could also be instance level (non-static) rather than class level! I think it would be easier to keep track of the collection this way.

Comment thread src/main/java/duke/TaskList.java Outdated
return todoList;
}

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

again, as with other lines of code, you could remove the space between the method name and parameter parentheses

aakanshanarain and others added 30 commits September 19, 2021 01:10
This reverts commit c228d14.

Reverting commit to be made in another branch
… comments

The Storage class had code at varying levels of abstraction. It had code that was responsible for parsing the stored tasks, as well as loading them into the UI at the same time.

Let's move the code responsible for parsing into the Parser class to eliminate that level of abstraction from the Storage class, keeping it solely responsible for storing and loading tasks to and from the storage file.

The Parser class already deals with all the relevant parsing needed to read user inputs and other text formats, so this maintains abstraction well. It also makes the code more readable as there is no convoluted parsing to read while looking at the code to load tasks to the UI.
Add assertions to some fragments of code
Tagging can be useful to keep track of similar tasks in the task list.

Let's add a tag command word and accordingly add methods to the Parser and UI classes, as well as make changes to the toString methods to make the UI messages more readable for the user in the case they add a tag to the tasks.

In keeping with the functions of the classes, the Parser parses the tag command and then the CommandHandler ensures the actual handling of the command. The UI class then returns the output message. This is in accordance to the levels of abstraction and classification established.
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.

3 participants