[Qiu Qianhui] iP#376
Conversation
ShanHng
left a comment
There was a problem hiding this comment.
Code is clean and easy to read! But there is repeated violation of the rule to have the [ ] placed behind the data type instead of variable name. Generally looks great!
| throw new DukeException(("☹ OOPS!!! The due date of a deadline cannot be empty.\n")); | ||
| } | ||
|
|
||
| String info[] = command.split(" /by "); |
There was a problem hiding this comment.
Perhaps we should put the [] right after the String instead even though this is valid too?
|
|
||
| String info[] = command.split(" /by "); | ||
| String description = info[0]; | ||
| String by = info[1]; |
There was a problem hiding this comment.
Maybe instead of just "by", we can use a variable name that indicates that this is a date?
| throw new DukeException("\t ☹ OOPS!!! The description, from date or due date of a event cannot be empty.\n"); | ||
| } | ||
|
|
||
| String info[] = command.split(" /from "); |
There was a problem hiding this comment.
Perhaps the naming of this variable can be a standard plural noun instead?
| } | ||
|
|
||
| public void event(String command) { | ||
| String info[] = command.split(" ", 2)[1].split(" /from "); |
There was a problem hiding this comment.
Ooh I like your clever usage of split to distinguish between /to argument and /from argument!
| public void addTask(Task task) { | ||
| tasks[taskIndex] = task; | ||
| taskIndex++; | ||
| System.out.println("\t Got it. I've added this task:\n" |
There was a problem hiding this comment.
I like what you did here - indenting and spacing a sentence into parts that are more readable!
| } | ||
|
|
||
| public void deadline(String command) { | ||
| String info[] = command.split(" ", 2)[1].split(" /by "); |
There was a problem hiding this comment.
Perhaps we could use a variable name that indicates this is an array? Also, remember to have the square brackets right after the data type~! (String[])
# Conflicts: # src/main/java/Event.java # src/main/java/Deadline.java
# Conflicts: # src/main/java/Deadline.java # src/main/java/Event.java # src/main/java/Task.java
# Conflicts: # src/main/java/command/AddDeadlineCommand.java # src/main/java/command/AddEventCommand.java # src/main/java/command/AddTaskCommand.java # src/main/java/command/AddTodoCommand.java # src/main/java/command/Command.java # src/main/java/command/DeleteTaskCommand.java # src/main/java/command/ExitCommand.java # src/main/java/command/ListCommand.java # src/main/java/command/MarkTaskCommand.java # src/main/java/storage/Storage.java # src/main/java/userinteraction/Ui.java
Assertions are used to define assumptions about the program state so that the runtime can verify them. Adding assertions in the code statements so that it can check whether the split operations used in the input string result in the correct output. It can help to detect the mistakes in the codes.
Some of the classes had some code quality violation that needed to be fixed according to the code quality rules. Deleting dead code and unused codes so that not trip up readers. Avoiding deep nesting and complicated expressions so that much more easier for reading. Trying to follow the single level of abstraction principle. These are helping to run-time efficiency and understandability.
Add assert statement in the TaskList class
* 'master' of https://github.com/QQH0828/ip: Add assert statement in the TaskList class
Modify the codes based on the code quality
* 'master' of https://github.com/QQH0828/ip: Modify the codes based on the code quality
Adding help command in the Duke to display all available commands with the explanation about how to use each commands.
Add a new line in each classes.
Remove whitespace of "trailing whitespace".
Add a space before "{".
Add and change some java doc.
Mainly from gui part.
Solve the issues about spacing after some commands.
Duke
Duke is a chatbot that frees your mind from having to remember the 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 random programmer that's looking through this, you can use it to practice Java as well. Here is the
maincode for the launcher.