-
Notifications
You must be signed in to change notification settings - Fork 461
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 Guai] iP #34
base: master
Are you sure you want to change the base?
[Ryan Guai] iP #34
Conversation
# Conflicts: # src/main/java/Duke.java
# Conflicts: # src/main/java/duke/parser/Parser.java
# Conflicts: # src/main/java/Duke.java # src/main/java/duke/task/Event.java
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.
Great work on your code so far! 👍
taskList.add(task); | ||
} | ||
|
||
public ArrayList<Task> searchMatches(String keyword) { |
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.
Perhaps method name of searchTasks
or searchMatchingKeyword
is better?
|
||
public ArrayList<Task> searchMatches(String keyword) { | ||
ArrayList<Task> matchingList = new ArrayList<>(); | ||
for (Task task: taskList) { |
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.
Should we add a spacebar here, after task
?
src/main/java/duke/main/Duke.java
Outdated
String dukeResponse = ""; | ||
try { | ||
switch (response) { | ||
case "find": { |
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.
Perhaps this line should have one less indent?
https://se-education.org/guides/conventions/java/intermediate.html#:~:text=Note%20there%20is%20no%20indentation%20for%20case%20clauses.
FileWriter myWriter = new FileWriter(this.filePath); | ||
StringBuilder output = new StringBuilder(); | ||
ArrayList<Task> tasks = taskList.getTasks(); | ||
for (Task task: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.
Perhaps can add spacebar here as well?
*/ | ||
public class Deadline extends Task { | ||
|
||
protected LocalDate by; |
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.
Perhaps the instance variable name can be more descriptive, e.g. deadlineDate
or date
?
|
||
/** | ||
* Marks task as done and prints message. | ||
*/ |
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.
Perhaps can add @return
here, as part of the Javadoc?
The previous mainClassName was incorrectly used as the default example given in the tutorial. Let's change it so that the JAR file generated is correct.
Let's enable assertions to check that important assumptions hold throughout the code.
Let's refactor code to remove unnecessary import statements, avoid magic literals and complicated expressions.
Use assertions
Let's provide a way to attach priorities to items. When the task list is printed, it would be useful to sort by priority.
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 are a Java programmer, you can use it to practice Java too. Here's the
main
method: