-
Notifications
You must be signed in to change notification settings - Fork 364
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
[cetigerlily] iP #89
base: master
Are you sure you want to change the base?
[cetigerlily] iP #89
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.
Looks good, hard to find stuff to comment on
src/main/java/duke/tasks/Task.java
Outdated
|
||
public class Task { | ||
private String description; | ||
private boolean status; |
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 "status" could be renamed to sound more booleanish like isDone or isComplete!
import duke.tasks.Task; | ||
|
||
public class DeleteCommand implements Command { | ||
private String 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 can add spaces between these lines!
@@ -0,0 +1,7 @@ | |||
package duke.exceptions; | |||
|
|||
public class DukeExceptions extends Exception { |
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 can add javadoc for this and other classes to explain what it is for?
timeFrame = eventStart.format(DateTimeFormatter.ofLocalizedDate(FormatStyle.SHORT)) + " " + | ||
eventStart.format(DateTimeFormatter.ofPattern("HH:mm")) + " to: " + | ||
eventEnd.format(DateTimeFormatter.ofPattern("HH:mm")) + ")"; |
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.
Would it be better to have like breaks before the operator? I noticed this violation of coding standards in other places too.
src/main/java/tigerlily/Parser.java
Outdated
public Command handleCommand(String input) throws DukeExceptions { | ||
try { | ||
CommandType command = CommandType.valueOf(input.split(" ")[0].toUpperCase()); | ||
switch (command) { | ||
case BYE: | ||
return new ByeCommand(); | ||
case LIST: | ||
return new ListCommand(); | ||
case TODO: | ||
return new ToDoCommand(input); | ||
case DEADLINE: | ||
return new DeadlineCommand(input); | ||
case EVENT: | ||
return new EventCommand(input); | ||
case MARK: | ||
return new MarkCommand(input); | ||
case UNMARK: | ||
return new UnmarkCommand(input); | ||
case DELETE: | ||
return new DeleteCommand(input); | ||
case FIND: | ||
return new FindCommand(input); | ||
default: | ||
throw new UnknownCommandException(); | ||
} | ||
} catch (IllegalArgumentException e) { | ||
throw new UnknownCommandException(); | ||
} | ||
} |
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 the use of a switch rather than multiple if/nested-if statements for ur handleCommand method.
package tigerlily.commands; | ||
|
||
import tigerlily.Storage; | ||
import tigerlily.Ui; | ||
import tigerlily.exceptions.DukeExceptions; | ||
import tigerlily.tasks.TaskList; | ||
|
||
public interface Command { | ||
void execute(TaskList taskList, Ui ui, Storage storage) throws DukeExceptions; | ||
} |
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 a separate Command class is used to handle all the commands.
FileWriter fw = new FileWriter(this.filePath); | ||
StringBuilder sb = new StringBuilder(); |
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 using more meaningful variable names a better option here?
Assertions are not present in code. Assertions are useful because they allow for the testing for validity of assumptions which were made in the program. Let’s add assertions to Parser, TaskList, Mark Command, and Unmark Command. Having assertions helps the smooth running of our code.
Code can be further reviewed to adhere to proper code quality standards. Code quality is important because it not only allows other users to read and understand it better, it will help you understand your own code better too. Let's edit the existing code to follow proper code quality standards. Having clean code allows us to understand our code better.
Add assertions
Review code quality
# Conflicts: # docs/Ui.png
🌷 tigerlily to-do 🌷
tigerlily to-do...
in it's current version, tigerlily to-do offers:
want to get tigerlily to-do? simply follow these steps:
if you're also a java programmer, tigerlily to-do can be used to practice java