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

[lordidiot] iP #527

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

Conversation

lordidiot
Copy link

@lordidiot lordidiot commented Sep 3, 2023

A heading

  • A
  • bullet
  • list
  1. A
  2. numbered
  3. list
def a_fenced_code_block():
    with syntax_highlighting() as x:
        pass
  • add a task list
  • watch lecture

🤓

a blockquote

a hyper link

inline code?

some text formatting: bold, italic, strikethrough etc.

Copy link

@Respirayson Respirayson left a comment

Choose a reason for hiding this comment

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

Looks good 👍
Just a few nitpicks here and there

private static boolean handleInput(Parser parser, TaskList taskList, Ui ui) throws DukeException {
Task task;
switch (parser.getCommand()) {
case "bye":

Choose a reason for hiding this comment

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

perhaps it would be better to consider the case that the user might input the correct word but a different capitalisation? For eg. instead of bye, the user inputs Bye or BYE.

Copy link
Author

Choose a reason for hiding this comment

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

Definitely, will work on that.

ui.exit();
}

private static boolean handleInput(Parser parser, TaskList taskList, Ui ui) throws DukeException {

Choose a reason for hiding this comment

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

I like the function in that it is succinct and it is very readable. However, I think you might want to consider refactoring the code and extracting this function into the Parser class as that class deals with making sense of the user commands.

* Initialise UI. Prints banner.
*/
public void init() {
System.out.println("____________________________________________________________");

Choose a reason for hiding this comment

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

Small thing but perhaps it would be better to turn the underline into a constant so it can be easily reused elsewhere

Copy link
Author

Choose a reason for hiding this comment

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

Thank you! That makes sense, will do so.

return new ArrayList<>();
}

ArrayList<Task> tasks = new ArrayList<>();

Choose a reason for hiding this comment

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

I like how you used tasks as the variable name for the Java Collections Object

package duke.mocks;

import duke.Task;
public class TaskMock extends Task {

Choose a reason for hiding this comment

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

I really like the usage of stubs when performing your unit testing. Really shows you went the extra mile!

* @throws DukeException Any errors encountered while storing
*/
public void storeTasks(List<Task> tasks) throws DukeException {
String serialized = tasks.stream()

Choose a reason for hiding this comment

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

Very cool usage of streams 👍

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