Skip to content

[Rama Venkatesh] iP#503

Open
ramaven wants to merge 58 commits into
nus-cs2103-AY2122S1:masterfrom
ramaven:master
Open

[Rama Venkatesh] iP#503
ramaven wants to merge 58 commits into
nus-cs2103-AY2122S1:masterfrom
ramaven:master

Conversation

@ramaven

@ramaven ramaven commented Sep 2, 2021

Copy link
Copy Markdown

Duke

"Sometimes our stop-doing list needs to be bigger than our to-do list."
~ Patti Digh, Four-Word Self-Help: Simple Wisdom for Complex Lives

Duke frees your mind of having to remember things you need to do. It is:

  • 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 and events
  • Marking item as done
  • Searching for items in your list

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

@Wilfredwongkc Wilfredwongkc 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! Just some nits on coding standards and then it should be fine.

Comment thread src/main/java/Duke.java Outdated
System.out.println(" Noted. I've removed this task: ");
System.out.println(" " + tasktoDel.toString());
}
else if(input.substring(0,8).equals("deadline")){

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Suggested change
else if(input.substring(0,8).equals("deadline")){
else if(input.substring(0,8).equals("deadline")) {

Comment thread src/main/java/Duke.java Outdated
System.out.println("Got it. I've added this task: ");
System.out.print(" " + newTask.toString());

} else if(input.substring(0,5).equals("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.

Suggested change
} else if(input.substring(0,5).equals("event")){
} else if(input.substring(0,5).equals("event")) {

Comment thread src/main/java/Duke.java Outdated
if(input.length()<4 ){
throw new DukeException("Unacceptable input");
}
if(input.substring(0,4).equals("todo")){

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Suggested change
if(input.substring(0,4).equals("todo")){
if(input.substring(0,4).equals("todo")) {

Comment thread src/main/java/Duke.java Outdated
Comment on lines +1 to +2
import tasks.*;
import exceptions.*;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Maybe can name out all the files that you are importing instead of using a wildcard?

Comment thread src/main/java/Duke.java Outdated
for(int i = 0; i < taskCounter; i++){
System.out.println((i+1) + "." + tasks.get(i).toString());
}
} else if (input.length() > 4 && input.substring(0,4).equals("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.

Suggested change
} else if (input.length() > 4 && input.substring(0,4).equals("done")){
} else if (input.length() > 4 && input.substring(0,4).equals("done")) {

Comment thread src/main/java/Duke.java Outdated
}
} else if (input.length() > 4 && input.substring(0,4).equals("done")){
String taskDone = input.substring(5);
int taskDoneIndex = Integer.parseInt(taskDone)-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.

Suggested change
int taskDoneIndex = Integer.parseInt(taskDone)-1;
int taskDoneIndex = Integer.parseInt(taskDone) - 1;

Comment thread src/main/java/Duke.java Outdated
System.out.println(tasks.get(taskDoneIndex).toString());
}
else {
if(input.length()<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.

Suggested change
if(input.length()<4 ){
if (input.length() < 4) {

Comment thread src/main/java/Duke.java Outdated
taskCounter++;
System.out.println("Got it. I've added this task: ");
System.out.println(" " + newEvent.toString());
} else if(input.length()>5 && input.length()<8){

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Suggested change
} else if(input.length()>5 && input.length()<8){
} else if (input.length() > 5 && input.length() < 8) {

Comment thread src/main/java/Duke.java Outdated
} else if(input.length()>5 && input.length()<8){
throw new DukeException("Unacceptable input");
}
else if(input.substring(0,6).equals("delete")) {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Suggested change
else if(input.substring(0,6).equals("delete")) {
else if (input.substring(0,6).equals("delete")) {

Comment thread src/main/java/Duke.java Outdated
Comment on lines +90 to +92
}} catch (DukeException e){
System.out.println("OOPS!!! You have enteted an invalid category");
}

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 can format the curly braces better?

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

Looks ok! I think you could work on the formatting of the braces as well as including whitespace in your code. Good luck!

Comment thread src/main/java/Tasks/DeadlineTask.java Outdated
}

@Override
public String toString(){

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

public String toString() {

Comment thread src/main/java/Tasks/DeadlineTask.java Outdated
@Override
public String toString(){
String typeString = type == TaskType.TODO ? "T" : type == TaskType.EVENT? "E" : "D";
String doneSymbol = isDone? "X" : " ";

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

String doneSymbol = isDone ? "X" : " ";

Comment thread src/main/java/Tasks/EventTask.java Outdated
@Override
public String toString(){
String typeString = type == TaskType.TODO ? "T" : type == TaskType.EVENT? "E" : "D";
String doneSymbol = isDone? "X" : " ";

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

String doneSymbol = isDone ? "X" : " ";

ramaven and others added 30 commits September 12, 2021 15:37
No assert statements are present.

Add statements are needed to declare for
things that ought to be true at that point in time
Find command is case sensitive

A case insensitive find is more user-friendly because users cannot be expected to remember the exact case of the keywords

Let's,
* update the search algorithm to use case-insensitive matching
Find command: make matching case insensitive
Coding standard not fully adhered to and SLAP principle not followed in Ui class

Adhering more closely to coding standards makes code more readable and better
understood, and following coding principles makes it easier for other programmers to
understand it.

Let's
* fix the order of import statements
* follow SLAP principle in Ui class' init method
* simplify complicated expressions in FindCommand class
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