-
Notifications
You must be signed in to change notification settings - Fork 270
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
[Tan Gee Teng] iP #281
base: master
Are you sure you want to change the base?
[Tan Gee Teng] iP #281
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like how you make most of the names sound straightforward and the code blocks are properly separated by empty lines!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall, methods and variables had followed the naming convention, good job!
@@ -85,4 +85,25 @@ public String count() { | |||
return "\n Now you have " + tasks.size() + " task" + isSingular + " in your list."; | |||
} | |||
|
|||
public String find(String keyword) { | |||
String resultStr = ""; | |||
boolean keywordFound = false; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Boolean variable should use a prefix such as is, has, was.
src/main/java/seedu/duke/Ui.java
Outdated
@@ -40,6 +44,9 @@ public void nextInput(String input, TaskList tasks) { | |||
case DELETE: | |||
myPrint(tasks.delete(Parser.getIndex(input))); | |||
break; | |||
case FIND: | |||
myPrint(tasks.find(Parser.getDescription(input))); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe it will be better to change the myprint() method name to something that would explain the function better
* @return String that describes the number of tasks in the TaskList | ||
*/ | ||
public String count() { | ||
String isSingular = "s"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why does the string variable had the prefix "is", it might be confusing for others as this prefix is reserved for boolean variables. It might be better to rename this variable :)
tasks.add(new Event("party ", LocalDate.of(2022, 12, 12))); | ||
tasks.add(new ToDo("borrow book")); | ||
|
||
TaskList t = new TaskList(tasks); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is it possible to rename this variable name so that it would be clearer in showing what you are doing?
Code was messy and might be unreadable Code quality improvement helps for future reference and checking. Let's * check for error-prone practices * delete all dead code
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
Branch merging pr
DukePro
DukePro frees your mind of having to remember things you need to do. It's
FASTSUPER FAST to useAll you need to do is,
And it is FREE
Features:
If you Java programmer, you can use it to practice Java too. Here's the
main
method: