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

[Rama Venkatesh] iP #503

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

Conversation

ramaven
Copy link

@ramaven ramaven commented Sep 2, 2021

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

Copy link

@Wilfredwongkc Wilfredwongkc left a comment

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.

System.out.println(" Noted. I've removed this task: ");
System.out.println(" " + tasktoDel.toString());
}
else if(input.substring(0,8).equals("deadline")){

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

System.out.println("Got it. I've added this task: ");
System.out.print(" " + newTask.toString());

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

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

if(input.length()<4 ){
throw new DukeException("Unacceptable input");
}
if(input.substring(0,4).equals("todo")){

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 on lines 1 to 2
import tasks.*;
import exceptions.*;

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?

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

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

}
} else if (input.length() > 4 && input.substring(0,4).equals("done")){
String taskDone = input.substring(5);
int taskDoneIndex = Integer.parseInt(taskDone)-1;

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;

System.out.println(tasks.get(taskDoneIndex).toString());
}
else {
if(input.length()<4 ){

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

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

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

} else if(input.length()>5 && input.length()<8){
throw new DukeException("Unacceptable input");
}
else if(input.substring(0,6).equals("delete")) {

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 on lines 90 to 92
}} catch (DukeException e){
System.out.println("OOPS!!! You have enteted an invalid category");
}

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?

Copy link

@aakanshanarain aakanshanarain left a comment

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!

}

@Override
public String toString(){

Choose a reason for hiding this comment

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

public String toString() {

@Override
public String toString(){
String typeString = type == TaskType.TODO ? "T" : type == TaskType.EVENT? "E" : "D";
String doneSymbol = isDone? "X" : " ";

Choose a reason for hiding this comment

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

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

@Override
public String toString(){
String typeString = type == TaskType.TODO ? "T" : type == TaskType.EVENT? "E" : "D";
String doneSymbol = isDone? "X" : " ";

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